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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Difficulties 2

Status
Not open for further replies.

campbere

Technical User
Oct 10, 2000
146
US
I am trying to run the following query in Oracle but I am getting no rows, when I know they exist.

select * from table where ddate > '31-DEC-98'

ddate is listed as a date column.

Can anyone help?
 
This should work as Oracle usually converts the string to a date date format. If it's the wrong format then it should complain.

To make sure it's converting to a date try:
select * from table where ddate > to_date('31/12/1998','DD/MM/YYYY')

 
try...

select * from table where ddate > to_date('31-DEC-98','DD-MON-RR')

or...

select * from table where ddate > '31-DEC-1998'


HTH,

Mike.
 
Thanks the to_date function was the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top