Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to query DATE type field correctly

Status
Not open for further replies.

JasonDBurke

Programmer
Jun 20, 2001
54
US
Hello,
I am querying a field of type DATE within the Oracle database. I would like to return the Maximum (most current) Date within the database. The Date String in the DB is stored in this format:
dd-mmm-yyyy hh:mm:ss

I've been trying a string like:

this doesn't work
SELECT MAX(DATEFIELD) FROM MAINTABLE.EVENT

this doesn't work
SELECT GREATEST(DATEFIELD) FROM MAINTABLE.EVENT

this doesn't work either
SELECT * FROM MAINTABLE.EVENT WHERE DATEFIELD > "11-Jan-1960 01:01:01 AM"

or
SELECT * FROM MAINTABLE.EVENT WHERE DATEFIELD > 0


Any suggestions are welcome!!! Thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top