SQL for date time is greater than 9AM today

Posted on 2009-05-15
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.  
Question by:ewang1205
  • 3
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);
LVL 15

Accepted Solution

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

Author Comment

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

Expert Comment

by:Shaju Kumbalath
ID: 24397514

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

Assisted Solution

reb73 earned 100 total points
ID: 24397535

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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle RAC 12c 8 73
Converting a row into a column 2 54
sort a spool into file output in oracle 1 30
clob to char in oracle 3 42
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to take different types of Oracle backups using RMAN.

823 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