mcnewsxp
2013-03-26 18:46:55 UTC
how code this correctly so I don't get this error: "Arithmetic overflow error converting expression to data type datetime." I know it's here: "GETDATE() - C1.Notice1Date" because notice1date will be null on some rows.
WHERE
(((GETDATE() - C1.IssueDateTime) > 7) AND (C1.Notice1Date IS NULL))
or
((C1.Notice1Date is not null)
and (((GETDATE() - C1.Notice1Date) > 7) AND (C1.Notice2Date IS NULL)))
WHERE
(((GETDATE() - C1.IssueDateTime) > 7) AND (C1.Notice1Date IS NULL))
or
((C1.Notice1Date is not null)
and (((GETDATE() - C1.Notice1Date) > 7) AND (C1.Notice2Date IS NULL)))