DateDiff vs Diff2Dates and trends

G

Guest

I am building a tool that tracks elapsed time from door to procedures etc.
There are many elapsed times required. I am using a form with the DateTime
Picker and command buttons to enter all the dates and times ex:
Me!MyDateTimeField = Me!DateTimePicker.

The fields in the table behind the form are General DateTime
The text boxes are all formatted mm/dd/yy hh:nn

I want to be able to trend the elapsed times on way or another. Using
Diff2Dates (Thank you Doug Steele) I get ex: 180 Minutes but this requires
that the field be text. DateDiff gives me 180, is this a number or time?

Could someone explain the best way to set this up and format the elapsed
time fields and/or text boxes? I would like to do it correctly from the
start. Thank you
 
D

Douglas J. Steele

DateDiff gives you a number (according to the Help file, DateDiff "Returns a
Variant (Long) specifying the number of time intervals between two specified
dates.")

To be able to do any sort of trend analysis, you'd need the difference to be
numeric.

However, I'm concerned about your statement "this requires that the field be
text". You do realize, I hope, that you shouldn't be storing the
differences?
 
G

Guest

Thanks for your help Doug. The duration of time ie: door to table 18
minutes, responded to page till arrival time 46 minutes

is an important part of the record and I wasn't sure how I should be
handling this data?

Inferring from your comment: when I want the duration of time I should be
using a query to result the time differences in every instance whether
displaying in a form or a report?
--
Jeff C
Live Well .. Be Happy In All You Do


Douglas J. Steele said:
DateDiff gives you a number (according to the Help file, DateDiff "Returns a
Variant (Long) specifying the number of time intervals between two specified
dates.")

To be able to do any sort of trend analysis, you'd need the difference to be
numeric.

However, I'm concerned about your statement "this requires that the field be
text". You do realize, I hope, that you shouldn't be storing the
differences?
 
D

Douglas J. Steele

Presumably you've got the times at which each event happened.

I think using a query to calculate the elapsed times would be best, although
on a form you can also set the ControlSource for the text box to the
function call.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jeff C said:
Thanks for your help Doug. The duration of time ie: door to table 18
minutes, responded to page till arrival time 46 minutes

is an important part of the record and I wasn't sure how I should be
handling this data?

Inferring from your comment: when I want the duration of time I should be
using a query to result the time differences in every instance whether
displaying in a form or a report?
 

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