Solved

SQL for date time is greater than 9AM today

Posted on 2009-05-15
5
3,864 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 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

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…
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…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

830 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