lcaraballo
6/8/2016 - 8:14 PM

SELECT CASE / SWITCH CASE SQL SERVER http://sqlperformance.com/2014/06/t-sql-queries/dirty-secrets-of-the-case-expression

SELECT 
StatusLabel = CASE [status]
    WHEN 'A' THEN 'Authorized' 
    WHEN 'C' THEN 'Completed' END,
LastEvent = CASE [status]
    WHEN 'A' THEN AuthorizedTime
    WHEN 'C' THEN CompletedTime END