random — 2012-11-07T06:14:54-05:00 — #1
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.
guido2004 — 2012-11-07T09:44:09-05:00 — #2
r937 — 2012-11-07T14:44:28-05:00 — #3
... 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