I am writing a query that counts the number of records for which the number of characters is less than 11.
SELECT sum(CASE when LEN(Summary) > 11 then 0 else 1) AS [SummaryErrorCnt],
sum(CASE when LEN(ResolutionNotes) >11 then 0 else 1) AS [ResolutionNotesErrorCnt]
FROM dbo.TicketLog
But I get an error
Msg 156, Level 15, State 1, Line 2 Incorrect syntax next to the keyword 'FROM'.
I close brackets correctly.
What am I doing wrong?
source
share