Click here to Skip to main content
13,046,375 members (120,708 online)
Rate this:
Please Sign up or sign in to vote.
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 22-Oct-12 10:39am
digimanus 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

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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 22 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100