Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ZMike
Posting Yak Master
110 Posts |
Posted - 2009-06-08 : 10:40:09
|
I have the following Statement that I would like to add the percent sign at the end but so far I have been unsucessful.=ROUND(SUM(Fields!Total_Cancelled_Orders.Value)/SUM(Fields!Work_Order_Count.Value)*100,2) I tried adding + "%" at the end and single quotes and a few other ways but it hasnt worked. |
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-06-08 : 10:43:56
|
cast(ROUND(SUM(Fields!Total_Cancelled_Orders.Value)/SUM(Fields!Work_Order_Count.Value)*100,2) as varchar(100))+'%'Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceled |
|
|
ZMike
Posting Yak Master
110 Posts |
Posted - 2009-06-08 : 10:59:30
|
So I'll have to fix it in the actual SQL instead of being able to just change it in the expression box in visual studio ? |
|
|
hanavan
Starting Member
25 Posts |
Posted - 2009-06-08 : 15:19:49
|
In the visual studio expression box you can add the % sign.=ROUND(SUM(Fields!Total_Cancelled_Orders.Value)/SUM(Fields!Work_Order_Count.Value)*100,2) + " %" |
|
|
ZMike
Posting Yak Master
110 Posts |
Posted - 2009-06-09 : 12:51:42
|
Hanavan,That's what I originally had and it wasnt working. I found out if I changed it to the "&" It worked=ROUND(SUM(Fields!Total_Cancelled_Orders.Value)/SUM(Fields!Work_Order_Count.Value)*100,2) & " %"I didnt want to do the data selection if I didnt have to since I had reporting Services doing the math instead of the actual SQL. Figured maybe this would help someone else out |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-09 : 13:21:32
|
quote: Originally posted by ZMike Hanavan,That's what I originally had and it wasnt working. I found out if I changed it to the "&" It worked=ROUND(SUM(Fields!Total_Cancelled_Orders.Value)/SUM(Fields!Work_Order_Count.Value)*100,2) & " %"I didnt want to do the data selection if I didnt have to since I had reporting Services doing the math instead of the actual SQL. Figured maybe this would help someone else out
you dont need to do this in expression. you can just give expression as =SUM(Fields!Total_Cancelled_Orders.Value)/SUM(Fields!Work_Order_Count.Value)and then select the standard percentage format available in textbox -> properties format tab. |
|
|
|
|
|