Jason-299789 (3/19/2013)
The simplest way is to do this as you now have the @VoucherType1 set is to dot his
CASE @vouchertype1
WHEN 'Discount' THEN @amountvalue
ELSE 0
END
this way when you have a vouchertype that ends with 'Discount' you apply the amount otherwise you simply insert a 0.
Thanks a lot Jason 🙂
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/