From: stonewall1974 on
I have a table that consists of a field named Minutes, multiple entries for a
specific individual may occur for any given day. I am placing a calculation
in a query that will break the minutes into 15 increments by using the
formula [Minutes]/15. The result value is coming up in correct when the units
are rounded; however, some values are rounded up. Example follows:

Minutes for a specific record; 5, 90, 50 for the same day = .333, 6, 3.333
respectively.

In the report the total = 9.667, which should reflect 9 only; in the report
it rounded to 10

The next record reflect
Minutes for a specific record;45, 70, 50, 15 for the same day = 3.000,
4.667, 3.333, 1 respectively.

In the report the total = 12, which is correct as 4.667 + 3.333 = 1.

What is the best way to handle this so that total minutes are calculated and
reflected correctly? I did try changing the properties, it did not work.

--
stonewall1974
From: John W. Vinson on
On Sat, 5 Jun 2010 11:36:22 -0700, stonewall1974
<stonewall1974(a)discussions.microsoft.com> wrote:

>I have a table that consists of a field named Minutes, multiple entries for a
>specific individual may occur for any given day. I am placing a calculation
>in a query that will break the minutes into 15 increments by using the
>formula [Minutes]/15. The result value is coming up in correct when the units
>are rounded; however, some values are rounded up. Example follows:
>
>Minutes for a specific record; 5, 90, 50 for the same day = .333, 6, 3.333
>respectively.
>
>In the report the total = 9.667, which should reflect 9 only; in the report
>it rounded to 10

The term "Rounded" does in fact MEAN rounded to the *nearest* value; if you
want 9.667 to become 9.000, then you're truncating, not rounding. Would you
want 9.99999985 to become 9, or 10?

To truncate use the Integer Divide operator instead of dividing and then
getting a fraction - that is, [Minutes] \ 15. The backslash will return:

30\15 = 2
31\15 = 2
44\15 = 2
45\15 = 3
--

John W. Vinson [MVP]
 | 
Pages: 1
Prev: Where is the startup manager in 2007
Next: none