Improve company productivity with a Business Account.Sign Up

x
?
Solved

SQL for date time is greater than 9AM today

Posted on 2009-05-15
5
Medium Priority
?
5,286 Views
Last Modified: 2012-05-07
Need a simple Oracle select to get update_ts is greater than 9AM today.  Please see the pseudo code below.

select * from test where update_ts > 9AM today.  
0
Comment
Question by:ewang1205
  • 3
5 Comments
 
LVL 15

Expert Comment

by:Shaju Kumbalath
ID: 24397460
select * from test where update_ts >to_date('15-may-2009 9:00','dd-mon-yyyy hh24:mi);
0
 
LVL 15

Accepted Solution

by:
Shaju Kumbalath earned 1600 total points
ID: 24397484
if u want to check it every day use
select * from test where update_ts >
trunc(sysdate)+9/24 ;
0
 

Author Comment

by:ewang1205
ID: 24397499
Is there a way to void the hard coded date 15-may-2009 and use sysdate instead?
0
 
LVL 15

Expert Comment

by:Shaju Kumbalath
ID: 24397514

select * from test where update_ts >
trunc(sysdate)+9/24 ;
0
 
LVL 25

Assisted Solution

by:reb73
reb73 earned 400 total points
ID: 24397535
or

select * from test where update_ts > dateadd('h',9,trunc(SYSDATE, 'DDD'));
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to recover a database from a user managed backup

595 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question