Except Friday Query [message #430086] |
Sun, 08 November 2009 02:34  |
mmsalman87
Messages: 41 Registered: September 2009 Location: kuwait
|
Member |
|
|
hi all
i am trying to write query that discount the number of friday days between two days How ?
example
from_date = 21/10/2009
to_date = 2/11/2009
the result should be
(to_date - from_date ) - number of friday days between two days
thanks in advanced
|
|
|
|
|
|
|
|
|
Re: Except Friday Query [message #430133 is a reply to message #430127] |
Mon, 09 November 2009 01:14   |
 |
ramoradba
Messages: 2457 Registered: January 2009 Location: AndhraPradesh,Hyderabad,I...
|
Senior Member |
|
|
Before posting..like the below...
Quote:thanks all
no thing of your posts solve my problem
post your sql session here...And letus know whats your requirement....
Say like given date is "friday" then result should include that or not... format your post Like the below...
SQL> ED
Wrote file afiedt.buf
1 Select Count(*) From(
2 Select To_Char(to_date('21-OCT-09','DD-MON-YY')+Rownum-1,'Day') D
3 From (
4 Select 1 From Dual Group By Cube(1,2,3,4,5,6))
5 Where Rownum<=(to_date('02-NOV-09','DD-MON-YY')-to_date('21-OCT-09','DD-MON-YY'))+1)
6* Where D!='FRIDAY'
SQL> /
COUNT(*)
----------
13
This will help you
http://asktom.oracle.com/pls/asktom/f?p=100:11:504503837393551::::P11_QUESTION_ID:185012348071
Sriram.
|
|
|
|
|