I assume that you are using this time field to store duration data (amount of
time it took to do something). Generally I would advise you to store
something like seconds instead, because it is relatively easy to format that
as a duration, but adding time doesn't make a whole lot of sense (what is
12:00:00 + 13:00:00).
Do you mean you want to sum theses values in the footer of a report? You
could add a textbox to the footer of the report and do something like:
ControlSource:=Timevalue(Sum(TimeValue([yourFieldname]))), but if the sum of
your durations exceeds 24 hours, your results would only give you the
hours/min/sec, not the days. Or, you could create your own function that
would return a string that looks like " xx days hh:mm:ss". I would do this
something like:
ControlSource:= FormatDuration(Sum(TimeValue([yourField])))
Public function FormatDuration(SomeValue as date) as string
Dim strDays as string
If DateDiff("d", #12/30/1899#, SomeValue) > 0 then
strDays = DateDiff("d", #12/30/1899#, SomeValue) & " days "
else
strDays = ""
endif
FormatDuration =strDays & Format(SomeValue, "hh:nn:ss")
End function
--
HTH
Dale
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.