469,601 Members | 2,039 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,601 developers. It's quick & easy.

Report Service calculation

Hi
i am working with report service in sql server 2005.
I have a problem with calculation.
what i want to do is something like this

=IIf Fields!total_spb_week_this_year.Value= 0 then 0
else
100 * (Fields!total_xch_comp_week_this_year.Value +
Fields!total_xch_1_4_1_week_this_year.Value) /
Fields!total_spb_week_this_year.Value

but i dont know what shall i add and wher shall i put.
i put this command in expression in the filed but it didnt work.

thanks alot for any help.
voroojak
Jul 12 '07 #1
4 1290
i just tried this and it seems that it is working, but i dont know how can i round it.
=IIF (Fields!total_spb_week_this_year.Value>0 ,
(Fields!total_xch_comp_week_this_year.Value +
Fields!total_xch_1_4_1_week_this_year.Value) * 100 /
Fields!total_spb_week_this_year.Value,0)

but thre result is 72.256471568124
but i want to get 72
or if it is 72.68545121654 i want to get 73

how is it possible.
i put ROUND at the begining but it didnt work.

thanks
Jul 12 '07 #2
You can use Formatting
Format (value,"N")......
Jul 12 '07 #3
thanks,
i tried to use round and it worked some how, can u please explain this function to me, because i also need to have with one digit decimal. i used round (X,1) but in some rows that it is for example 2.4000001, it dowsnt give me me 2,4 or if it is 2.5.99999 it is not giving me 2.6.
thanks alot for ur help.
Jul 12 '07 #4
This is the formatting options provided in the reporting service.
Format (value,"N") -- two decimal points
Format(value,"N1") -- one decimal point
etc..,
Jul 13 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Trevor Best | last post: by
4 posts views Thread by =?Utf-8?B?S2F1c2hhbCBNZWh0YQ==?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.