Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Time format (Access 2000)

    I have the following formula in Excel that I would like to use in Access. Unfortunately the rounddown is not part of the function in Access. My problem in Access is that I have total seconds and need to change it to hh:mm:ss

    Thanks

  2. #2
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time format (Access 2000)

    I don't see a "following formula" but you can use formatting in Access to get the results you're looking for...
    For example... MyStr = Format(MyTime, "hh:mm:ss")

  3. #3
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time format (Access 2000)

    Thanks for the reply: My problem is I have time in seconds and needs to translate it to hh:mm:ss. I've manage to do it in Excel with the help of Rounddown, but it looks very clumsy. Unfortunately Access doesn't recognize Rounddown so now my formula wouldn't work. Any ideas will be appreciated.

    Mario

  4. #4
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time format (Access 2000)

    Oops... Totally missed that one... Sorry!! <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    You'll need to use a combination of the Int() function and the Mod operator...
    Total seconds in an hour is 3600...
    Total seconds in a minute is 60...
    (fldOriginal is the amount you already have in seconds)

    Therefore:

    hours = Int(fldOriginal / 3600)
    minutes = Int((fldOriginal Mod 3600) / 60)
    seconds = Int((fldOriginal Mod 3600) Mod 60)

    So:

    fldConvertedTime = CStr(Format(Int(original / 3600), "00")) & ":" & CStr(Format(Int((original Mod 3600) / 60), "00")) & ":" & CStr(Format(Int((original Mod 3600) Mod 60), "00"))

    This will give you the format you want...
    HTH

  5. #5
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Time format (Access 2000)

    Thanks. It seems to look beter in Excel, but still an mission. <img src=/S/bow.gif border=0 alt=bow width=15 height=15>

Posting Permissions

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