Stored Procedure

  • Hi
      IN below code i want that this Case condition should also check , If Type = 'T' and t.Period = 'Q' then only if month = 3 or 6 or 9 or 12 only then this Case Statement should gets executed.

    UPDATE T SET T.Amount = CASE 
            WHEN T.[Type] = 'T' THEN ((T.Amount * 70/100) )
            ELSE 0
            END
        FROM [Test]    T where Month = @m_month

    Thanks


  • UPDATE T SET T.Amount = CASE
    WHEN T.[Type] = 'T' AND t.Period = 'Q' AND [Month] IN ( 3, 6, 9, 12 ) THEN ((T.Amount * 70/100) )
    ELSE 0
    END
    FROM [Test] T where [Month] = @m_month

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

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