ms sql + a conditional where statement
Posted on 2006-06-10
Is it possible to have a conditional where statement if so how.
ie if a value in the select statement equals a something then the part of the where statement would equal one thing if not another
this is what i tried.
WHERE completed = 1
AND CASE WHEN touch_reason in (19,20) THEN
DATEDIFF(hour, cdol.maxdate , getDate()) > 12
DATEDIFF(hour, cdol.maxdate , getDate()) > 0