Calculate Times

B

Bill

Group,

Please help... :)

I have a text field (someone elses database that I can not change) storing
the time something was checked out. Then another field (text) storing the
time it was checked in. I need to calculate the difference between these two
fields in days, hours and minutes. The field names are:
[chekoutime] and [returntime]

By the way, if needed I have two other fields, named [chekoutdat] and
[returndate]. These fields are date/time fields but only storing the date (no
times).

Thanks for your help
 
J

John W. Vinson

Group,

Please help... :)

I have a text field (someone elses database that I can not change) storing
the time something was checked out. Then another field (text) storing the
time it was checked in. I need to calculate the difference between these two
fields in days, hours and minutes. The field names are:
[chekoutime] and [returntime]

By the way, if needed I have two other fields, named [chekoutdat] and
[returndate]. These fields are date/time fields but only storing the date (no
times).

Thanks for your help

I'd suggest concatenating the two fields and using CDate:

DateDiff("n", CDate([chekoutdt] & " " & [chekoutime]), CDate([returndate] & "
" & [returntime]))

will give the duration in minutes. It's a bit more code to get the elapsed
time in days/hours/minutes, and that's a bit ambguous - does this refer to
working hours, or 24/7?
 

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

Top