I have two fields named BegTime and EndTime that are using a default value of
time(). Then I have another field named TotalTime that I would like to have a
total of these two fields. Example 10:00 + 11:00 = 1.0. Does anyone know how
I could do this?
I take it that you want the DIFFERENCE of the two times, not the total
- the time elapsed, no?
Take a look at the DateDiff() function. Your "TotalTime" field should
NOT exist in this table, or any other table; since it can be derived
from the BegTime and EndTime values, storing it would be redundant and
unwise. Instead, create a Query based on the table; select the BegTime
and EndTime fields, and in a vacant Field cell type
TotalTime: DateDiff("n", [BegTime], [EndTime]) / 60.
to calculate the time difference in minutes and then divide by 60 to
get fractional hours.
Note that this will not work over midnight; Time() is actually a
date/time value on December 30, 1899. If you'll ever want to span
midnight, you'ld do better to use Now() rather than Time() as the
default, to include both the date and the time.
John W. Vinson[MVP]