Case can be used in the Select to translate the output to something else…




,’D1′ As [Description]




,L.Column2 As [Date]




When P.Column4 = 1 Then ‘Objective 1’

When P.Column4 = 2 Then ‘Objective 2’

When P.Column4 = 3 Then ‘Objective 3 – Doing Now’

Else ”

End As [Return Reason]

From TableP P

Inner Join TableL L On P.PID = L.PID

Left Outer Join TableM M On L.LID = M.LID And M.GroupID In (77, 88)

Where P.IsTrue = 1