Solved

SQL for date time is greater than 9AM today

Posted on 2009-05-15
5
4,023 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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 100 total points
ID: 24397535
or

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to recover a database from a user managed backup

738 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