Groups | Blog | Home
all groups > sql server reporting services > june 2007 >

sql server reporting services : Render REAL datatype values


matt.skibbs NO[at]SPAM gmail.com
6/7/2007 11:21:58 PM
What is the best approach to displaying a REAL datatype value with RS?
When I query them in QA, they are returned correctly... such as 0.15
or 0.5. When I display them in a RS report they often come out as
0.15000000034. I know this is because they are approximate floating
point values, but I need to improve their readability in our reports.

Thanks!
Lisa Slater Nicholls
6/8/2007 3:03:22 PM
[quoted text, click to view]

There is a big difference between, "correctness" or accuracy, and
"readability"... what makes you think QA is returning them "correctly"? <s>
I'm not a great data type expert so I am not sure I should say anything
either way here... IAC...

If you want to improve "readability", use the FormatNumber() function...
that's prolly the easiest way while there are many possible functions to
use... or you could also opt to CAST the REAL in the SQL.

"Best approach" would IMHO depend on two things:

* -- which are you most comfortable writing (VB or SQL) ? BUT, trumping
that:

* -- is the SQL in question dedicated to providing reporting results or does
it have multiple uses? In which case, no matter how comfortable you are in
the SQL, format at the reporting-expression level instead <s>.

[quoted text, click to view]
AddThis Social Bookmark Button