Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL for date time is greater than 9AM today

Posted on 2009-05-15
5
Medium Priority
?
4,567 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

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…
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.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

885 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