NoodlesWIU
asked on
SQL datetime where selection
We have an Oracle backend database that I am trying to select records from where the field EntryDate >= 08/26/2010
EntryDate is in the DateTime format, so not a string, and I have been unsuccesful and forming a query to accomplish this.
If I output the data to the screen for a praticular record I get
2010-08-26 00:00:00
even trying a selection of
Select First_Name FROM students WHERE EntryDate ='08/26/2010'
or
Select First_Name FROM students WHERE EntryDate ='2010-08-26 00:00:00'
I get no results. Can anyone help me form a query to get this accomplished.
EntryDate is in the DateTime format, so not a string, and I have been unsuccesful and forming a query to accomplish this.
If I output the data to the screen for a praticular record I get
2010-08-26 00:00:00
even trying a selection of
Select First_Name FROM students WHERE EntryDate ='08/26/2010'
or
Select First_Name FROM students WHERE EntryDate ='2010-08-26 00:00:00'
I get no results. Can anyone help me form a query to get this accomplished.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>EntryDate >= '2010-08-26'
I always recommend explicit data type conversions. Then there can be no confusion.
I always recommend explicit data type conversions. Then there can be no confusion.
ASKER
I just used the second option you gave. I didnt know you could explicitly define it. Thanks!
WHERE EntryDate >= '2010-08-26'
AND EntryDate < '2010-08-27'