Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vavjeeva
Starting Member
1 Post |
Posted - 2004-10-07 : 00:48:54
|
| Hi guys,i need a sql query to find out Fourth Monday, tuesday or... in a Given Date..i have a query to find out fourth Friday of Given Dateselect (28-((Datepart(weekday, DATEADD(mm, DATEDIFF(mm,0,getdate()), 0) ))%7))For example, If the Date is Oct 2004 ,the Result is 22the same way i want to to find out for all other days.. thanks in advanceJeeva S |
|
|
dev45
Yak Posting Veteran
54 Posts |
Posted - 2004-10-07 : 02:50:46
|
| simple thoughtif your query always returns the 4th Friday thensubtracting 1 u get the fourth tuesubtracting 2 u get the foruth wedand so on... or u do u want to have a single select statement for all ? |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-10-11 : 18:36:10
|
| >> if your query always returns the 4th Friday thensubtracting 1 u get the fourth tueNope - could be +6.Think I posted something to that would do this recently - not sure if it was on this site though.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
|
|
|
|
|