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 2005 Forums
 Transact-SQL (2005)
 Find the Name of a day

Author  Topic 

ischenk
Starting Member

15 Posts

Posted - 2008-07-15 : 12:37:23
Hello. I need to be able to plug in a date and have it show me the name of that day.

Example:

'07-15-2008' = 'Tuesday'

If someone could help me out with this, I'd be greatful.

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2008-07-15 : 12:39:41
SELECT datename(weekday,'07-15-2008')
Go to Top of Page

ischenk
Starting Member

15 Posts

Posted - 2008-07-15 : 12:50:44
Will that work in SQL Server 2005? Someone told me that it wouldn't, but he might just be an idiot.
Go to Top of Page

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2008-07-15 : 12:53:51
it works in SQL Server 2005
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-15 : 13:25:12
Seems he's an idiot.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-15 : 13:33:01
quote:
Originally posted by ischenk

Will that work in SQL Server 2005? Someone told me that it wouldn't, but he might just be an idiot.


why dont you try it and see rather than believing what someone said?
Go to Top of Page

ischenk
Starting Member

15 Posts

Posted - 2008-07-15 : 13:58:21
Well, I'm at work and I can't test it here. However, when I showed my buddy the string, he said that he didn't think it would work. So, I just thought I'd ask. Trust me, it's not a normal occurance.
Go to Top of Page
   

- Advertisement -