I'd like to create a select statement with the following pseudocode:
select * from temperatures
where tm != monday
tm is a datetime
field.
I'd like to create a select statement with the following pseudocode:
select * from temperatures
where tm != monday
tm is a datetime
field.
You can use DAYOFWEEK()
:
select *
from temperatures
where datepart(weekday, tm) <> 2
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';