SELECT MIN(Measurement),
(CASE 'NonDesMin'
WHEN len(measurement) = 6 then '0000'
ELSE '000'
END) as [Min]
FROM LeachingView
WHERE DateTimeStamp > '2011-01-01'
AND measurement > 0
This is my SQL statement. I want to check the length of the field measurement, and if it is 6 characters long i want to display four 0's, else three 0's. i can getting an error:
incorrect syntax near '='.