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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSRS 2005 weird rounding issue

Status
Not open for further replies.

nsimmons

Technical User
Apr 3, 2002
19
GB
Hi All - this is doing my head in so I'd be grateful for any help.

This is an expression I've put on a field in my reporting services report.

=iif (Fields!ACTION_CODE.Value="DRFT80",(((Fields!BASE_AMT.Value)/80)*20),0)
OR iif (Fields!ACTION_CODE.Value="DRFT85",(((Fields!BASE_AMT.Value)/85)*15),0)
OR iif (Fields!ACTION_CODE.Value="DRFT90",(((Fields!BASE_AMT.Value)/90)*10),0)

As you can see it performs a calculation based on the contents of a field called Action_code.

Now if I put only the first iif statement in the expression

=iif (Fields!ACTION_CODE.Value="DRFT80",(((Fields!BASE_AMT.Value)/80)*20),0)

I get the value 95.20 for a line output when the report is run for a DRFT80. If I add the rest of the iif statment to the expression the value is output as 95.00 for the same line - i.e it's rounded !! - but I'm not asking it to round and the field format is set to display 2 dec places... I have no idea how or why it's doing this - but obviously it's making my figures incorrect....

Any help would be great.
Cheers,
Neil.
 
Hey all - had a brainwave and tried a big nested IIF statement and it seems to have worked. There are 6 different values the action code can be so the statement looks like below....

=iif (Fields!ACTION_CODE.Value="DRFT80",(((Fields!BASE_AMT.Value)/80)*20),iif (Fields!ACTION_CODE.Value="DRFT85",(((Fields!BASE_AMT.Value)/85)*15),iif (Fields!ACTION_CODE.Value="DRFT90",(((Fields!BASE_AMT.Value)/90)*10),iif (Fields!ACTION_CODE.Value="OTHR80",(((Fields!BASE_AMT.Value)/80)*20),iif (Fields!ACTION_CODE.Value="OTHR85",(((Fields!BASE_AMT.Value)/85)*15),iif (Fields!ACTION_CODE.Value="OTHR90",(((Fields!BASE_AMT.Value)/90)*10),0))))))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top