View Single Post
  #2  
Old June 5th, 2010, 08:29 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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]