Questions

Answer for:

TSQL If/When issue

Message 7 of 8

View entire thread
+
0 Votes
coolaid09

Changed the bottom part of the query to:
and exists
(Select eventid from
eventrecords
where TaskName = 'End') then 1
else 0 as bit
end
order by eventid desc

Now it throws: 'Incorrect syntax near the keyword 'then'.'