Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Ok, so I am having a problem with a report I am creating in SSRS. I am getting some unwanted rounding when I enter a unique expression. It only does it on the data I am trying to pull for the current accounting period and not the contract to date data. Has anyone seen this before and is there a way to get rid of the rounding?

Here is the unique expression I am using: =Sum((Fields!CostAmnt.Value) and (Fields!AcctPrd_Name.Value = Parameters!AcctPrd_Name.Value)).

Seems simple enough but for some reason it is causing a rounding. I have my parameter less than or equal to the accounting period. When selected, it will display the contract to date for the accounting period shown. That is working correctly. However, when I add columns in and set them to the expression above, I am experiencing rounding. HELP!!

Here is an example of the data it is returning:
Segment CurrentMonth(note rounding) Contract to Date(note no rounding)
ISEGD $12,812.00 $20,730.77

This contains the detail behind it. The current month should reflect $12,812.50.
IWAROSS01 IWA ROSS 01 1001 201306 3/15/2013 12:00:00 AM $12,812.50


Hope this is not all too confusing. Please contact me for further questions. Thanks!
Posted
Comments
Herman<T>.Instance 23-Oct-12 3:54am    
which of these values have datatype int and which have datatype float or decimal?
cast al these values to float.
Sum((cast(Fields!CostAmnt.Value) as float) and ( cast(Fields!AcctPrd_Name.Value as float) = cast(Parameters!AcctPrd_Name.Value as float)))
NeNe4877 23-Oct-12 9:20am    
The crazy part is they are all data type float. If I remove the unique expression from

=Sum((Fields!CostAmnt.Value) and (Fields!AcctPrd_Name.Value = Parameters!AcctPrd_Name.Value))

and change it to
=Sum(Fields!CostAmnt.Value)

then the numbers come in right without the rounding. But it is not pulling just the current month when I remove the

and (Fields!AcctPrd_Name.Value = Parameters!AcctPrd_Name.Value))

At a loss with this. Not sure why the expression would make it round.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900