none
querry assistance in sql

    Question

  • SELECT
    CASE WHEN e.EA_STATUS IN ('E4', 'U4', 'P5', '02', '03', '04') and t.TRANS_GROUP IN ('3500', '9100')
    THEN 1 -- PROJECT 
    WHEN e.EA_STATUS NOT IN ('E4', 'U4', 'P5', '02', '03', '04') and t.TRANS_GROUP IN ('3500')
    THEN 2 -- NON PROJECT 
    ELSE 0 -- UNKNOWN 
    END AS EXPENDITURE_GROUP_SK
    FROM dbo.STG_FMTMPROD_V_EA_STATUS AS e
    inner join dbo.STG_FMTMPROD_V_TRANS_GROUP as t
    on e.STATUS = t.STATUS

    This is a querry I am working on.Do you know how I can convert the 0,1, and 2 to be treturned as string so I can have the project , non-project and unknown  aa my option rather than the numbers.

    Thanks.

    Friday, April 11, 2014 6:33 PM

Answers

All replies