• Daniel Bowlin (1/27/2011)


    If it returns 2.36 you are encountering something called banker's rounding where a 5 will round up to an even number, but a 5 will round down if the round up number is odd. In other words the 5 will alway round in the direction of the even number whether that is up or down.

    I think the use of CDec is invoking the bankers rounding somehow. Try dropping that function if you can; maybe put the rounding in the query if that's possible.

    For what it's worth, here's something more from MSDN:

    When the fractional part is exactly 0.5, CInt and CLng always round it to the nearest even number. For example, 0.5 rounds to 0 and 1.5 rounds to 2. CInt and CLng differ from the Fix and Int functions, which truncate, rather than round, the fractional part of a number. Also, Fix and Int always return a value of the same type as is passed in.

    Though it doesn't include CDec in that list, I wouldn't be surprised if it behaves like CInt and CLng.