I was wondering if someone could help. The following query is has error
case when [Time Taken for First ] >'24:00'
'>24' else 0 end as '1st assess',
from [dbo].['assessment ']
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value '>24' to data type int.
The column is nvarchar(255)
Answer by ThomasRushton ·
Try wrapping the 0 in quotes too.
I'm guessing, as you've not provided any sample data, that you have other rows that are returned first, and that calculation for those rows returns the zero value - which is a number - so the server is trying to build a column full of numbers, but then it comes across a value which is attempting to return a string, and can't do that...