Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Time Field (Duration) (2002)

    I am a fairly novice Accesser.

    I have an application where I want to track the duration of an event in minutes:seconds. I don't care whether the colon appears (I can handle that), but I would like to validate correct entries and perform some simple math.

    I tried to use short time (where I would pretend it was mm:ss rather than hh:mm), but that limits me to 24 "minutes".

    Is there any simple way to do this or am I going to need to code like hell?

  2. #2
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time Field (Duration) (2002)

    In a new column in the query use
    TimeDuration: DateDiff("n",[Field1], [Field2]) & " : " & (DateDiff("s",[Field1], [Field2])Mod 60)

    Change Field1 and Field2 to you field names. This assumes the format for your time is hh:nn:ss
    Paul

  3. #3
    New Lounger
    Join Date
    Feb 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time Field (Duration) (2002)

    While that function will help with the math, what I am really looking to solve is how to store the basic durations. I am not storing a start date/time and an end date/time. I want to store the duration as minutes:seconds (e.g., 124:22 would be 124 minutes and 22 seconds). Math comes later. What is the best format for a column that would hold that type of data?

  4. #4
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time Field (Duration) (2002)

    Without doing any calculations on the information, you would probably have to store is as TEXT. That is the only way I know of to store it as minutes:seconds. This would certainly affect how you calculate things down the road.
    Paul

  5. #5
    Star Lounger
    Join Date
    Aug 2001
    Location
    Seattle, Washington, USA
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time Field (Duration) (2002)

    Paul's right about the difficulties in storing the elapsed time in minutes:seconds. Even as text.

    You might want to consider storing the elapsed time in total seconds, and let your math calculate the minutes:seconds later.

    Tom

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

Posting Permissions

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