How do I subtract starting time from ending time

P

Patty0621

How do I subtract starting time from ending time and post the result to
another field in access. I. E.

Start time 10:15AM
End Time 11:00AM
Result should be 45 (minutes.)

Thank you.
 
D

Douglas J. Steele

DateDiff("n", #10:15#, #11:00#)

However, you should NOT store that in a table. As fellow MVP John Vinson
likes to say ""Storing calculated data generally accomplishes only three
things: it wastes disk space, it wastes time (a disk fetch is much slower
than almost any reasonable calculation), and it risks data validity, since
once it's stored in a table either the Total or one of the fields that goes
into the total may be changed, making the value WRONG."

Instead, create a query that uses that formula as a computed field, and use
the query wherever you would otherwise have used the table.
 

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