-1

I'd like to create a select statement with the following pseudocode:

select * from temperatures
where tm != monday

tm is a datetime field.

xralf
  • 3,312
  • 45
  • 129
  • 200

3 Answers3

2
 select * from temperatures
    where DATEPART(WEEKDAY, tm) != 2
1

You can use DAYOFWEEK():

select * 
from temperatures
where datepart(weekday, tm) <> 2
The Impaler
  • 45,731
  • 9
  • 39
  • 76
1

I think this answers your quastion Get day of week in SQL Server 2005/2008

in your case

select * from temperatures
where DATENAME(dw,tm) != 'monday';