Home » SQL & PL/SQL » SQL & PL/SQL » Date Comparison and Manipulation
Date Comparison and Manipulation [message #293576] Mon, 14 January 2008 02:42 Go to next message
Messages: 1
Registered: January 2008
Junior Member

I needed some help in creating a query. I have not tried much due to lack of awareness of SQL. So I turn to everyone on this forum for help.

I'm fetching 2 dates, each from a different table and want to check if a weekend exists between those two dates.

Also if there exists a weekend I want to calculate the time elapsed between those two date, excluding the hours of the weekend(minus 48hrs).

If someone can help me or direct me in creating such a query, please do.


[Updated on: Mon, 14 January 2008 03:19] by Moderator

Report message to a moderator

Re: Date Comparison and Manipulation..PLEASE HELP!!! [message #293579 is a reply to message #293576] Mon, 14 January 2008 03:18 Go to previous messageGo to next message
Michel Cadot
Messages: 63908
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please, read and follow OraFAQ Forum Guide:
1/ Post your Oracle version
2/ Don't use UPPER CASE and things like "PLEASE HELP!!!" above all in title.
3/ Post a test case: create table and insert statements. Also post the result you want with these data.
4/ Carefully read "How to format your post?" section. Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button to verify.
5/ Post what you tried and why you are stuck.


[Updated on: Mon, 14 January 2008 03:18]

Report message to a moderator

Re: Date Comparison and Manipulation [message #293591 is a reply to message #293576] Mon, 14 January 2008 03:40 Go to previous message
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Hint :

SQL> select TRUNC(SYSDATE) TO_DATY from dual;


SQL> select TRUNC(SYSDATE) - TO_DATE('01-JAN-2008','DD-MON-YYYY') DIFF from dual;


SQL>  SELECT TO_CHAR(TO_DATE('06-JAN-2008','DD-MON-YYYY'),'DAY') DAY from dual;



Thumbs Up

[Updated on: Mon, 14 January 2008 03:42]

Report message to a moderator

Previous Topic: Formulization at Query level
Next Topic: Send attachment with email using pl/sql
Goto Forum:

Current Time: Fri Oct 21 06:35:39 CDT 2016

Total time taken to generate the page: 0.06365 seconds