I am writing a case statement and need to add a value if the row count is 0 ...Here is my code
does anyone have any suggestions
thanks
Code:
update A
Set SDBACHE_STLEV
= CASE
When (b.Hours_Earned) Between 0 and 27.990 Then '02'
When (b.Hours_Earned) @@RowCount = 0 Then '02'
When (b.Hours_Earned) Between 28 and 57.990 Then '03'
When (b.Hours_Earned) Between 58 and 87.990 Then '04'
When (b.Hours_Earned) Between 88 and 999 Then '05'
Else '10'
End
from sdbache A join Hours b
on a.sdbache_id = b.Hours_id
and sdbache_stlev = '10'
does anyone have any suggestions
thanks