OfficeFrustration

OfficeFrustration (http://www.officefrustration.com/index.php)
-   General Discussion (http://www.officefrustration.com/forumdisplay.php?f=22)
-   -   MS Access 2007 Query _ Report (http://www.officefrustration.com/showthread.php?t=1119699)

stonewall1974 June 5th, 2010 07:36 PM

MS Access 2007 Query _ Report
 
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

John W. Vinson June 5th, 2010 08:29 PM

MS Access 2007 Query _ Report
 
On Sat, 5 Jun 2010 11:36:22 -0700, stonewall1974
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]


All times are GMT +1. The time now is 04:47 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
OfficeFrustration.com