which Condition apply?

  • I have the Employees Table which canting the following data

    Empcode Basic Pay H.Rent

    65 800 800

    89 800 800

    96 750 1000

    I want if the empcode is differ and Basic Pay and House Rent Amount Same then “CHECK IT” Else

    “OK”

    somebody help me which condition is apply here Please

  • Here is something to get you started

    CREATE TABLE #t(Empcode INT, BasicPay Money, Rent Money)

    INSERT INTO #T

    SELECT 65, 800, 800 UNION ALL

    SELECT 89, 800, 800 UNION ALL

    SELECT 96, 750, 1000

    SELECT Empcode,'Action '=

    CASE

    WHEN BasicPay = Rent THEN 'Check it'

    WHEN BasicPay <> Rent THEN 'OK'

    END

    FROM #t

    Results

    Empcode Action

    65Check it

    89Check it

    96OK

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply