Calculation woes

J

JP6262AMY

I have a form to enter help desk calls. We have one field with start time and
one with end time. Then we have a field to calculate the number of minutes
spent on each call. That field is called "Minutes".

In my monthly report, we detail the month's calls. Then we want a total of
the minutes. The expression we created was =Sum([Minutes])

For one month, the total was 298 minutes, but the expression returned
29.0416666666

What's up with that? Thanks.
 
L

Larry Linson

JP6262AMY said:
I have a form to enter help desk calls. We have one field with start time
and
one with end time. Then we have a field to calculate the number of minutes
spent on each call. That field is called "Minutes".

In my monthly report, we detail the month's calls. Then we want a total
of
the minutes. The expression we created was =Sum([Minutes])

For one month, the total was 298 minutes, but the expression returned
29.0416666666

What's up with that? Thanks.

I'm not certain... because the remainder when dividing 298 by 60 is not
29.04.... but what type of field / variable are you using to store the
result? How are you calculating the Minutes?

If it is a Date/Time type, that could be a problem because Date/Time is for
storing a point in time. A value of minutes might be stored in an Integer,
Long Integer, Floating Point, or Double Precision Floating Point.

Larry Linson
Microsoft Access MVP
 
K

KARL DEWEY

You should not be storing a calculated field. Calculate it at report time
or just display it on your form. Did you include the date in the start and
end fields? Do you have some calls completed the next day?
 
K

Klatuu

It is how you are doing it. First, you need to convert the start and end
times to a time value using the TimeSerial function.
You need to use either the TimeSerial or TimeValue functions to convert them
to a date type. Then you need to use the DateAdd function to get the elapsed
minutes.
You can look up the details on these functions in VBA Help.
 
Top