Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    convert number to hours (Access 2003)

    I am trying to convert a number for example 70 in a query to state 1:10 in a query, (and will need to be a format which can be added up later in a report)...my field is called MINUTES which lists the 70, and my new formula field beside it is going to be called TIME. I know I must put in the expression as TIME:[MINUTES] blah blah blah, it's the blah blah blah part I'm having problems with. Can anyone help? Thank you for your feedback.

    Oh, PS...even rounding to the nearest hour is ok...a 1 for example in place of the 70
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: convert number to hours (Access 2003)

    You can use
    <code>
    TimeSerial(0, [Minutes], 0)
    </code>
    or
    <code>
    [Minutes] / 1440
    </code>
    (1440 = 24 * 60 is the number of minutes in a day; 1 day is the unit in which all date and time values are expressed)

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: convert number to hours (Access 2003)

    I had worked on it until I came up with TIME: [MINUTES]/1440*24 and it gives me 1.17 for 70 minutes...is this pretty much the same thing your saying Hans?
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: convert number to hours (Access 2003)

    IS there a way to get the AM portion out of the 1:10 AM answer I receive?

    I used your TimeSerial(0, [Minutes], 0)
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: convert number to hours (Access 2003)

    Set the format for the field or text box to a suitable time format.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: convert number to hours (Access 2003)

    [Minutes] / 1440*24 is not correct, it converts a number of hours to a time value

    [Minutes] / (1440*24) converts a number of seconds to a time value.

  7. #7
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: convert number to hours (Access 2003)

    Got it...Thank you so much as always Hans!
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

Posting Permissions

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