Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Total time calculation

0 views
Skip to first unread message

philwade

unread,
Jun 22, 2003, 8:47:57 PM6/22/03
to
I need to calculate the total time taken in an operation. Example - I went
to sleep at 10:00 PM on June 22 and woke up at 7:00 AM on June 23. Is there
a way in Access 2000 to calculate the total time asleep, either in a time or
decimal format? I would like to show this both on a form and on a report.
I freely confess I have forgotten everything I ever knew about programming
Access forms and reports, thinking I would never need that knowledge again!
Thanks in advancer. I am sure I will be calling on y'all again.

Phil Wade


Allen Browne

unread,
Jun 22, 2003, 9:55:33 PM6/22/03
to
Create a query into this table.
In a fresh column of the query design grid (Field row), enter:
Minutes: DateDiff("n", [StartTime], [EndTime])

The query now displays the number of minutes for the operation. Crossing
dates is no problem.

To display this as minutes and fractions, just divide by 60.

To display the result as hours and minutes, use a text box with
ControlSource of:
=[Minutes] \ 60 & Format([Minutes], "\:00")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")

"philwade" <phil...@bayou.com> wrote in message
news:_fGdnaMsxN7...@www.bayou.com...

philwade

unread,
Jun 23, 2003, 12:23:21 PM6/23/03
to
Much thanks for the quick post. Works great. I knew I had to use a query
but couldn't figure out the math.

Phil Wade
"Allen Browne" <abrowne1...@bigpond.net.au> wrote in message
news:%23JQiypS...@tk2msftngp13.phx.gbl...

0 new messages