Solved

SQL for date time is greater than 9AM today

Posted on 2009-05-15
5
3,629 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
Comment Utility
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 400 total points
Comment Utility
if u want to check it every day use
select * from test where update_ts >
trunc(sysdate)+9/24 ;
0
 

Author Comment

by:ewang1205
Comment Utility
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
Comment Utility

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

Assisted Solution

by:reb73
reb73 earned 100 total points
Comment Utility
or

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

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…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to recover a database from a user managed backup

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now