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
 SQL Server Development (2000)
 Returning day of week

Author  Topic 

jparker
Posting Yak Master

118 Posts

Posted - 2006-08-31 : 08:18:10
Hello

I need to do analysis on a date field to return those dates that are only a friday or a sunday.

What is the best way to implement this?

Thanks in advance

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-31 : 08:21:22
SELECT * FROM YourTable WHERE DATEPART(dw, YourColumn) IN (6, 1)

But beware! This setting approach is dependent of SET DATEFIRST setting


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

jparker
Posting Yak Master

118 Posts

Posted - 2006-08-31 : 08:24:22
thanks very much

easy when you know how :)
Go to Top of Page
   

- Advertisement -