• That would be correct as part of a SELECT statement. CASE isn't a statement, it's an expression used within a query.

    So

    SELECT

    CASE WHEN fmwa.GroupNbr<>'' THEN 'NO'

    WHEN dind.DefaultIndicator='Y' THEN 'YES'

    ELSE 'NO'

    END AS Default_ID,

    CASE WHEN tagagt.AgencyName=''

    THEN RTrim(LTrim(tagagt.LastName)) + N', ' + RTrim(LTrim(tagagt.FirstName))

    ELSE RTrim(LTrim(tagagt.AgencyName))

    END AS WA_Name

    FROM <some table> ....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass