Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

formatting fields to show currency in SSRS

Tags:

I am trying to format a field for salary and can't seem to bring out the currency symbol when doing the formatting. I have tried using the text box field formatter and then I have tried using the expression below.

When I re-run my report after entering the expression I get a #ERROR in the output. Is there anything else I can try?

=Format(Fields!number.Value, "£")
like image 798
Tito Paterson Avatar asked Dec 09 '13 11:12

Tito Paterson


People also ask

How do I format a column to money in SQL?

In SQL Server, you can use the T-SQL FORMAT() function to format a number as a currency. The FORMAT() function allows you to format numbers, dates, currencies, etc. It accepts three arguments; the number, the format, and an optional “culture” argument.

How do you display money in SQL?

Different Ways to Format Currency Output in SQL For example, in the USA we use the $ for the currency symbol and a decimal point as a separator. Whereas in Latin America, we use the decimal point instead of a comma as the separator.


1 Answers

Set the textbox format as C0, i.e. currency to 0 decimal places:

enter image description here

This will be affected by the report Language property - set to en-GB for pounds, as in your example:

enter image description here

You can also set the textbox properties, which also gives you the option to set the symbol outside of the report language:

enter image description here

Finally, you can use a string like:

=Format(Fields!number.Value, "C0")

This does change the field type to a string, unlike the other options, which can have en effect if exporting to Excel.

like image 179
Ian Preston Avatar answered Oct 07 '22 19:10

Ian Preston