Sunday in Month [message #382370] |
Thu, 22 January 2009 01:04  |
sweetkhaliq
Messages: 200 Registered: April 2006
|
Senior Member |

|
|
Dear Group Members
i want to make a query to show all sundays in a specific month or in specific two dates.
Please tell me how can i acheive this task.
Thanks and regards
[Updated on: Thu, 22 January 2009 01:11] Report message to a moderator
|
|
|
|
|
Re: Sunday in Month [message #382434 is a reply to message #382392] |
Thu, 22 January 2009 05:15   |
imran_nu
Messages: 55 Registered: February 2007 Location: Islamabad
|
Member |
|
|
here it is
You can find more about this on this forum...
However, i solved the similar problem with the help of littlefoot
select edat,TO_CHAR(EDAT,'DAY')
from (select TO_DATE(:sdat,'DD-MON-YYYY') + LEVEL -1 EDAT from dual
CONNECT BY LEVEL <= TO_DATE(:EDAT,'DD-MON-YYYY') - TO_DATE(:SDAT,'DD-MON-YYYY') + 1)
WHERE TO_CHAR(EDAT,'DAY') LIKE '%SUNDAY%'
cheers
|
|
|
Re: Sunday in Month [message #382443 is a reply to message #382434] |
Thu, 22 January 2009 06:02  |
 |
Michel Cadot
Messages: 68733 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Of course instead of using brute force you can be a little smarter and find the arithmetical formula.
Regards
Michel
|
|
|