Casting in expressions
Im trying use an expression, to remove the negative sign from a decimal value and add CR at the end to idicate its a credit, below is what i tried - gives errors. = Iif(Fields!amount.Value < 0, cast(abs(Fields!amount.Value) as varchar(20)) + "CR",Fields!amount.Value) Please help Rebekah
July 7th, 2011 8:02am

Hi, Try this.... =IIF(Fields!Amount.Value < 0, CStr(Abs(Fields!amount.Value)) + "CR", Fields!amount.Value) Hope its helpful....Pavan Kokkula Tata Consultancy Services.
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 8:06am

Hi, Try this.... =IIF(Fields!Amount.Value < 0, CStr(Abs(Fields!amount.Value)) + "CR", Fields!amount.Value) Hope its helpful.... Pavan Kokkula Tata Consultancy Services. This might not work as the two cases have different data types. If you do get errors, try: =CStr(Abs(Fields!amount.Value)) + IIF(Fields!Amount.Value < 0, + " CR","")If this post, or another, answers your question, please click the 'Mark as answer' button so others with the same problem can find a solution more easily.
July 7th, 2011 8:14am

Hi Rebekah, Try this.... =IIF(Fields!Amount.Value < 0, CStr(Abs(Fields!amount.Value)) & "CR", Fields!amount.Value) Amit Mark as answer if found useful
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2011 5:16pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics