Solved

Oracle Where Clause Current_Date and Time

Posted on 2011-03-11
6
953 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 77

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 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35110799
Glad to help.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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 77

Expert Comment

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

 trunc(sysdate)+14/24
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

729 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