Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

So i have a table which i want to search for specific data on a specific date and time.

I have a field called DT which consist on date and time. I can be able to return research for specific date but i m having issue to return specific time as well.

so for example i have:

SQL
select t.*, t.rowid from customers t where trunc(created_date) = to_date ('07/08/2015, 'mm-dd-yyyy')

Now the field that holds the data is like this:

04/08/2015 11:34:24 AM

So my question is how do i modify my SQL to bring back results for that specific time??

Thanks in advance!
Posted
Updated 14-Apr-15 1:41am
v2
Comments
Maciej Los 14-Apr-15 7:40am    
What's database provider: Oracle, MySQL, PostrgreSQL?
Geofferz 14-Apr-15 7:49am    
I m using PLSQL (Oracle)

1 solution

SQL
Use time format HH:MI:SS in your to_date function, Like this
where created_date > to_date('07/08/2014 15:14:30' , 'DD/MM/YYYY HH24:MI:SS')
 
Share this answer
 
v5
Comments
Geofferz 14-Apr-15 8:28am    
Thank you very much that did the trick :)
John C Rayan 14-Apr-15 8:37am    
Happy to help ;)
Maciej Los 14-Apr-15 9:08am    
+5!
John C Rayan 15-Apr-15 5:35am    
Thanks

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