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

x
?
Solved

Oracle Where Clause Current_Date and Time

Posted on 2011-03-11
6
Medium Priority
?
957 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 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 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 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35110799
Glad to help.
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
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 78

Expert Comment

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

 trunc(sysdate)+14/24
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
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.
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.
Suggested Courses

824 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