SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


format related problem in SSRS: to show upto # decimal places


format related problem in SSRS: to show upto # decimal places

Author
Message
nayak.shridevi
nayak.shridevi
Old Hand
Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)

Group: General Forum Members
Points: 311 Visits: 131
IN REPORTING SERVICES (SSRS)

The expression in a cell is like
=Sum(Fields!a.Value)/Sum(Fields!b.Value)

in output .. i want to show upto 5 decimal places.

Is this possible with a format string?? or any other solution??
Jason Hall
Jason Hall
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1022 Visits: 82
If you only want 5 decimal places to show up you can use the following as your format string.

#.#####

The pound sign indicates that only 5 numbers should be shown after the decimal. If you always want 5 decimal places to show even for integers you can use zero's instead of pound signs.

For example if you use #.##### as your format string , and the value is 5 it will display as 5.

If the value is 5 and you use #.00000 as your format string, it will display as 5.00000.

Please let me know if this helps.
Niraj-627298
Niraj-627298
SSC Eights!
SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)

Group: General Forum Members
Points: 985 Visits: 719
Hello...

Please try this once and let me knw if it helps...

=Format(Sum(Fields!a.Value)/Sum(Fields!b.Value),"#.#####");

Thanks,
nayak.shridevi
nayak.shridevi
Old Hand
Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)

Group: General Forum Members
Points: 311 Visits: 131
this is a partial solution... thanks

But if the value is calulated to "0"... then nothing is displayed in that cell
where as output expected is "0.00000"

similarly ... if the value is calculated to "0.123456789" .... then the output expected is "0.12345" .... and "#.#####" displays it as ".12345"
Glen Sidelnikov
Glen Sidelnikov
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1771 Visits: 804
# - specifies an optional placeholder
0 - specifies required placeholder

Format(Table!Field.Value,"#0.00000")

will always return 5 digits after comma.
nayak.shridevi
nayak.shridevi
Old Hand
Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)Old Hand (311 reputation)

Group: General Forum Members
Points: 311 Visits: 131
thanks Glen Sidelnikov Smile

"#0.00000" worked!! BigGrin
Niraj-627298
Niraj-627298
SSC Eights!
SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)SSC Eights! (985 reputation)

Group: General Forum Members
Points: 985 Visits: 719
My pleasure....

You can try this...

=IIf((Field!val1.Value/Field!val2.Value)>0,Format((Field!val1.Value/Field!val2.Value)),"#0.00000"),"0.00000")

..Let me knw...if it works..

Thanks...
shilpareddy2787
shilpareddy2787
SSC-Enthusiastic
SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)

Group: General Forum Members
Points: 188 Visits: 66
Hello,

You can directly Format the TextBox as "N5", then you can get the 5 decimal places for the Number.

Hope this helps
vijayp.net
vijayp.net
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 13
Thanks, Shilpa..
thats better option to format the textbox to display result upto 5 decimal places
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search