I am rewriting code from MS Access to T-SQL (SQL Server 2008 R2) and this one had me stumped. I know I would need to use the CASE ... WHEN
statement but this one is involving many columns and then count those that have '0's.
IIf(S.Knowledge1=0,1,0) +IIf(S.Routing1=0,1,0) +IIf(S.DataEntry1=0,1,0) +IIf(S.DataEntry2=0,1,0) +IIf(S.DataEntry3=0,1,0) +IIf(S.Scripting1=0,1,0) +IIf(S.Conduct1=0,1,0) +IIf(S.Conduct2=0,1,0) +IIf(S.Conduct3=0,1,0) AS CoachingCount