Calculate a Time Date Stamp - start and stop

  • Thread starter Thread starter Aso
  • Start date Start date
A

Aso

I have two fields one is "TimeDateStampStart" and the other is
"TimeDateStampStop" Each is in a different table because start is affiliated
with the base form and the stop is part of the subform.

I am not having problems displaying the data on the form or on the query but
i need to calculate the difference in time between the Stop time/date and the
Start time/date. Ive tried some of the other suggestions listed here but to
no avail, therefore I've decided to ask for help specifically.

Any help is appreciated.
Thank you
 
Put both tables in one query and join on the fields that are your
Master/Child links.
Use a calulated field.
 
using the calculated field is yielding a long decimal value. Both fields are
in the format: 3/12/2009 8:55:45 AM
 
You have to format the output display as input formats will not be passed
through a calculation.
 
using the calculated field is yielding a long decimal value. Both fields are
in the format: 3/12/2009 8:55:45 AM

A Date/Time field *is* a Double Float number, a count of days and fractions of
a day (times) since midnight, December 30, 1899. The format doesn't affect
what's stored, only how that value is displayed.

It's best to use the builtin DateDiff() function to calculate durations.
Subtracting two date/times will give a value in fractional days, but (for
example) if you get a result of 28 hours, it will display as

12/31/1899 04:00:00 AM

which is likely to be more confusing than helpful!

The DateDiff function lets you choose the granularity of the time difference:
DateDiff("s", [start time], [end time]) will give an integer number of
seconds; using "yyyy" instead of "s" will give you integer years, and you can
use "n" for miNutes, "h" for hours, "d" for days, "m" for Months in between.
 

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

Back
Top