How do I subtract starting time from ending time

  • Thread starter Thread starter Patty0621
  • Start date Start date
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.
 
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.
 
Back
Top