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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 how to get name of the day?

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=1
tuesday =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
Go to Top of Page

wotrac
Yak Posting Veteran

98 Posts

Posted - 2004-11-25 : 15:19:24
Hi

Sorry 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??

Go to Top of Page

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
Go to Top of Page
   

- Advertisement -