Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004
    Location
    Fort Worth, TX
    Posts
    43

    Unanswered: Calculating Time Span

    OK, I have seen alot of threads concerning TIme. But none of them seem to answer the question I have.

    I am wanting to calculate a timespan that bridges days as well and show that in Hours and minutes:

    I have 2 fields StartTime and EndTime. Each one is attached to a "Stamp Button" that sets the value of the fields to Now(). I would like to see the difference between these to fields in Hours and Minutes.

    I have tried a simple [EndTime]-[StartTime] but the date is not accounted for and I can't seen to get them formated the right way.

    Help!

  2. #2
    Join Date
    Jan 2005
    Posts
    40
    I've had this problem before, and I think you're going to have to break it up into segments, i.e. days, hours, minutes...... If you're hoping to get this into a singly field, you may have some fun with that... you ,may want to consider you valuable this information will be to you.....

  3. #3
    Join Date
    Sep 2004
    Location
    Charlotte, NC
    Posts
    164
    This may not be the most efficient way to do it, but it will provide you with the results that you asked for:

    ElapsedTime: Format(Int((DateDiff("n",[starttime],[endtime]))/60),0) & " Hours and " & Format((DateDiff("n",[starttime],[endtime]))-(Int((DateDiff("n",[starttime],[endtime]))/60)*60),0) & " Minutes"

    TD

  4. #4
    Join Date
    Dec 2004
    Location
    Fort Worth, TX
    Posts
    43

    Thank You

    That last bit of Code did the trick. Thanks

    Now I would like to sum this information at the bottom of the form. I have converted the elapsed time to show me minutes for the sum at the bottom of the form, but now I want to see 2 hours and 3 minutes instead of 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •