Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to return rows from a table, call it A where i have a create_date field. In the talble i have data (21-MAR-11) in that field but when i sort on it it does not work. How can i get the date field to return rows with a certain date? i have tried Trunc fucntion but its not working. Any help would be appreciated.

>select a.item_oid from ods_own.A
Where trunc(a.create_date) = to_date(‘20110321’,’YYYYMMDD’)
Posted

1 solution

i guess you need to convert this to datetime

Where Convert(DateTime,a.create_date) = Convert(DateTime,to_date)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900