Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ssrs formating 2

Status
Not open for further replies.

jmk418

MIS
May 24, 2004
99
0
0
US
hi
i have a field in ssrs that has a formula:

= (sum((Fields!contrast.Value * Fields!Cases.Value )) /sum( Fields!Cases.Value ))

this i can format fine using n0 to have no decimal places
but if i add text to the end of the formula:

= (sum((Fields!contrast.Value * Fields!Cases.Value )) /sum( Fields!Cases.Value )) & " cc"

the formating does not work anymore
does anyone know how to correct this?
thanks
jeremy
 
I don't know much about SSRS but it looks like you're trying to concatenate a number to a string. Convert the number to a string and see what happens.
 
i cant convert the number to a string in the field on the report
is there anyway i can format the number and still add the string value to the end
 
What is ssrs and does it have anything to do with SQL Server? This is the Microsoft SQL Server: Programming forum.
 
its sql server reporting services and there is not currently a seperate forum for reporting services
 
jmk418,

You should be able to cast the numeric as a string, and then concatenate.

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
-----------
A skeleton walks into a bar, and says "I'll have a beer and a mop.
 
Skip playing with the format code because ssrs gets confused trying to apply a numeric format code to the entire expression because the addition of the string to the end of the expression makes the expression not exclusively numeric.
convert the first part an integer using the cint command and your statement will work.

= cint((sum((Fields!contrast.Value * Fields!Cases.Value )) /sum( Fields!Cases.Value ))) & " cc"

SSRS is a very nice tool but it there is very little information out there. I have recently begun developing a reporting solution using this tool and I encourage all users to post their knowledge here.
Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top