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
 General SQL Server Forums
 New to SQL Server Programming
 converting 10/10/2008 into "Friday"

Author  Topic 

sqlchiq
Posting Yak Master

133 Posts

Posted - 2008-10-10 : 11:32:26
I have a column of dates but I want the name of the day instead.

tried convert(dddd, column) no luck

tried datepart(dddd, column) it gives me the date in number format, i need the actual name of the day. Anyone?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-10 : 11:39:59
select datename(dd,column) from table
Go to Top of Page

sqlchiq
Posting Yak Master

133 Posts

Posted - 2008-10-10 : 11:42:11
quote:
Originally posted by visakh16

select datename(dd,column) from table



The output is still in number.

Eg. for 10/10/2008 it displays 10 instead of "Friday"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-10 : 11:43:38
select datename(dw,column)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-14 : 03:34:08
quote:
Originally posted by visakh16

select datename(dw,column)


I prefer weekday in place of dw which is more readable

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-14 : 03:51:23
quote:
Originally posted by madhivanan

quote:
Originally posted by visakh16

select datename(dw,column)


I prefer weekday in place of dw which is more readable

Madhivanan

Failing to plan is Planning to fail


yeah...it really is more readable..Its been my habit to use dw always
Go to Top of Page
   

- Advertisement -