difficult query
-
hello, I have a table named: 'Applicant' having fields: 'id_Applicant', 'name,'date_of_birth','date_of_death' the sql or oracle query is: 'Select all applicant who are alive on 30-05-2012' Please it's urgent thanks alot.
What have you tried so far?
The difficult we do right away... ...the impossible takes slightly longer.
-
hello, I have a table named: 'Applicant' having fields: 'id_Applicant', 'name,'date_of_birth','date_of_death' the sql or oracle query is: 'Select all applicant who are alive on 30-05-2012' Please it's urgent thanks alot.
m_safaaaa wrote:
Please it's urgent
That's a big no no to say in a forum post. People will help you when they can. As the other poster has mentioned, what have you tried so far?
""Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
hello, I have a table named: 'Applicant' having fields: 'id_Applicant', 'name,'date_of_birth','date_of_death' the sql or oracle query is: 'Select all applicant who are alive on 30-05-2012' Please it's urgent thanks alot.
I suspect that 2012-05-30 just might possibly be between the date_of_birth and the date_of_death (or some date in the future if null). :~ You are using DATE or DATETIME fields, right? Right?
-
hello, I have a table named: 'Applicant' having fields: 'id_Applicant', 'name,'date_of_birth','date_of_death' the sql or oracle query is: 'Select all applicant who are alive on 30-05-2012' Please it's urgent thanks alot.
Posting in multiple forums is considered rude. Please find an appropriate forum and stick to it: Difficult query please it's urgent[^]
Sandeep Mewara [My last tip/trick]: Server side Delimiters in ASP.NET[^]
-
hello, I have a table named: 'Applicant' having fields: 'id_Applicant', 'name,'date_of_birth','date_of_death' the sql or oracle query is: 'Select all applicant who are alive on 30-05-2012' Please it's urgent thanks alot.
SELECT * FROM Applicant WHERE Date_Of_Death > CONVERT(VARCHAR,'30-05-2012',106) - Happy Coding - Vishal Vashishta
-
hello, I have a table named: 'Applicant' having fields: 'id_Applicant', 'name,'date_of_birth','date_of_death' the sql or oracle query is: 'Select all applicant who are alive on 30-05-2012' Please it's urgent thanks alot.
Either date_fo_death is null or greater than the given date:
SELECT *
FROM Applicant
WHERE date_of_death is null
OR date_of_death>@somedate -
SELECT * FROM Applicant WHERE Date_Of_Death > CONVERT(VARCHAR,'30-05-2012',106) - Happy Coding - Vishal Vashishta
Works great, if the guy is still alive today... Your query selects all who have already died past that date - that's a difference.
-
hello, I have a table named: 'Applicant' having fields: 'id_Applicant', 'name,'date_of_birth','date_of_death' the sql or oracle query is: 'Select all applicant who are alive on 30-05-2012' Please it's urgent thanks alot.
SELECT
id_Applicant,
name,
date_of_birth,
date_of_death
FROM
Applicant
WHERE
'5/30/2012' BETWEEN date_of_birth AND ISNULL(date_of_death,'1/1/3000')