Calculating/Storing Elapsed Time for Future Averaging

G

Guest

Please have patience for a true novice here . . . I have read through so many
threads and other suggestions on calculating elapsed time, but still have
some issues. Specifically, I'm using a form to automatically calculate &
store "Time Opened" and "Time Closed" for trouble tickets. (It actually
seems to be working and storing the correct info in the underlying table!)

I created a query to calculate the elapsed time between the two fields in
the table: Time to Resolution: [DTS Activities]![Time Closed]-[DTS
Activities]![Time Opened]. The result displayed is in the following format:
0.0010300. . .

I would also like to calculate an average length of time each trouble
tickets was open. Can I do this in the same query, and, if so, what
expression would I use?

The final question would be how do I store this data in the underlying
table, so I can generate a report from it? Or should I just use the Query to
pull the data from for the report?

Thank you for any assistance you can provide me!!
 
L

Lynn Trapp

The function for Average should get what you want, but you will need to
generate that in your report footer, rather than in the query --
Average([DTS Activities]![Time Closed]-[DTS Activities]![Time Opened]).
Also, you should not need to store this value. Simply use the query as the
record source for your report.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html
 
J

John Spencer

I would use DateDiff("n",[TimeOpen],[TimeClosed]) to calculate the number of
elapsed minutes.

You can use the Avg function in a Totals query to get the average minutes.

Avg(DateDiff("n",[TimeOpen],[TimeClosed]) ) as AverageMinutes

Usually it is best NOT to store derived data if you can calculate it.
Trouble with storing the data if you can derive it is you must recalculate
it if any of the values used to calculate the derived data changes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top