Solved

Oracle Where Clause Current_Date and Time

Posted on 2011-03-11
6
947 Views
Last Modified: 2013-12-19
Ok I know this is going to be an easy one and I just do not deal with time that often in my current work.

I have a column called REQ_DT that is a DATE column and holds the date an account was requested (ex 2/27/2011 10:16:44 PM) as well as the time. I just need to have a where clause that selects all of the REQ_DT's where the REQ_DT is less than or equal to the CURRENT_DATE 2:00:00 pm

So basically all of the requests that were submitted before today at 2:00pm. Hope that anyone can assist.
0
Comment
Question by:mjfigur
  • 3
  • 2
6 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 35110771
Try this:
select * from table were req_dt <= to_date(to_char(sysdate,'MM/DD/YYYY') || '14:00:00','MM/DD/YYYY HH24:MI:SS');
0
 

Author Closing Comment

by:mjfigur
ID: 35110788
Cannot thank you enough worked pefect!
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35110799
Glad to help.
0
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.

 
LVL 11

Expert Comment

by:Akenathon
ID: 35110801
select * from <table_name> where req_dt <= trunc(sysdate)+14/24
0
 
LVL 11

Expert Comment

by:Akenathon
ID: 35110808
Oops... too late :-)
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35110816
Just getting ready to post the alternative...  you beat me

 trunc(sysdate)+14/24
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

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to recover a database from a user managed backup

743 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

12 Experts available now in Live!

Get 1:1 Help Now