FORMATTING NUMBERS IN SSRS

December2000
December2000 used Ask the Experts™
on
Hi Experts, Why isnt this working?

= Switch(Fields!SERVICEUOM.Value=  "JTS" ,format(Fields!SERVICEQTY.Value,"#,###.##"),Fields!SERVICEUOM.Value= "EACH",format(Fields!SERVICEQTY.Value,"#,###.##"), Fields!SERVICEUOM.Value= "END",format(Fields!SERVICEQTY.Value,"#,###.##"))
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011

Commented:
Where do you have that expression?

Author

Commented:
Thank you @ wdosanjos,  I tried in the text box expressions and in the advanced mode properties... hope I am using the correct terminology
Top Expert 2011

Commented:
I think all you need to do is set the text box format property to #,###.##.  I'm not sure why you need to put that expression, if all switch values provide the same format.
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Author

Commented:
depending on the value of Fields!SERVICEUOM.Value, if it is JTS, END or EACH the format should actually be x,xxx  else the format should be x,xxx.xx for the  other 7 values of  Fields!SERVICEUOM.Value.
Top Expert 2011
Commented:
OK. So, on the format property of the text box (SERVICEQTY, I guess), add the following:
=Switch(Fields!SERVICEUOM.Value= "JTS" ,"#,###.##",Fields!SERVICEUOM.Value= "EACH","#,###.##", Fields!SERVICEUOM.Value= "END","#,###.##",True,"#,####")

Open in new window

Author

Commented:
I put it in the textbox > properties > Format and it worked great!

Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial