Solved

Oracle Where Clause Current_Date and Time

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

Question has a verified solution.

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

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

840 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