Calculate a Time Date Stamp - start and stop

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
 
K

KARL DEWEY

Put both tables in one query and join on the fields that are your
Master/Child links.
Use a calulated field.
 
A

Aso

using the calculated field is yielding a long decimal value. Both fields are
in the format: 3/12/2009 8:55:45 AM
 
K

KARL DEWEY

You have to format the output display as input formats will not be passed
through a calculation.
 
J

John W. Vinson

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.
 
Top