Solved

Oracle Where Clause Current_Date and Time

Posted on 2011-03-11
6
948 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle DATE Column Space 11 63
Need a replacement data type in Oracle 6 65
join 2 views with 5 conditions 3 45
Oracle - SQL Where clause causing Invalid Number Error 4 27
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
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 explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database

920 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

16 Experts available now in Live!

Get 1:1 Help Now