Adding date onto existing date for a where clause

wanting to gather rows that dateFoo is not the same as dateBar + day(1) tried using DATEADD without any success, for example: select * from table where dateFoo != DATEADD(dayofyear, 1, dateBar) but get the error back: Syntax error: Data Type “dayofyear” does not match Defined Type name. also tried a + 1, but that seems to only work on oracle and not sql.

http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-add


select * 
from table 
where dateFoo <> DATE_ADD(dateBar, INTERVAL 1 DAY)

… WHERE dateFoo <> DATEADD(day,1,dateBar)

of course, that’ll only work if dateFoo and dateBar are actual DATE or DATETIME columns

p.s. guido, it’s microsoft sql server