Rounding to nearest quarter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am doing a vacation report that would give an employee vacation to the
nearest quarter hour of vacation.

My data in the query is:
43.08
92.31
111.54
106.42

I would like to round these hours of vacation to show as:

43.0
92.25
111.5
106.5

In the case of 92.31 the decimal is less than .37 (the median between .25
and .5) so we would round down to .25. In the case of 106.42 the decimal is
greater than .37 ( the same median) so we would round up. The same logic
would apply with the other quarter hours. For the life of me, I cant figure
this one out.

Thanks!
Barb
 
Worked like a charm...THANKS!
Barb

KARL DEWEY said:
Try this and replace [Cost] with your field name.
To the quarter: Int(4*[Cost]+0.25)/4
--
KARL DEWEY
Build a little - Test a little


BAFFEE said:
I am doing a vacation report that would give an employee vacation to the
nearest quarter hour of vacation.

My data in the query is:
43.08
92.31
111.54
106.42

I would like to round these hours of vacation to show as:

43.0
92.25
111.5
106.5

In the case of 92.31 the decimal is less than .37 (the median between .25
and .5) so we would round down to .25. In the case of 106.42 the decimal is
greater than .37 ( the same median) so we would round up. The same logic
would apply with the other quarter hours. For the life of me, I cant figure
this one out.

Thanks!
Barb
 
Back
Top