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 |
|
tusharkashyap
Starting Member
3 Posts |
Posted - 2004-11-25 : 08:16:56
|
| I wanna know how to get the name of the particular day from the select query:select datePart (dw,getDate()).it gives number for that day.e.g. monday=1tuesday =2 and so on but i need the day in words.PlZ tell me ???Thanks for your time |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-11-25 : 08:18:33
|
select datename(dw, getdate())Go with the flow & have fun! Else fight the flow |
 |
|
|
wotrac
Yak Posting Veteran
98 Posts |
Posted - 2004-11-25 : 15:19:24
|
| HiSorry to tag onto your thread, but I am looking for something very similar.I need the day name, plus I want to know what number this would be in the month.eg. If the day is friday, is it the 1,2,3,4 or fifth Friday in the Month?? |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-11-25 : 22:40:05
|
[code]select case (day(getdate())/7)+1 when 1 then '1st ' when 2 then '2nd ' when 3 then '3rd ' when 4 then '4th ' when 5 then '5th ' end + datename(dw,getdate())[/code]Corey |
 |
|
|
|
|
|