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

    Rounding to Quarter Hour (Access 2003)

    I have a report that takes the time given in a "TIME" field (typed in as minutes) and changes it to Hours with the formula, =24*Sum( [TIME ]) and format of a General Number. I need the time rounded to the nearest quarter hour, for example, if I receive 979.78 for an answer of the (In HOURS) I would like it rounded to 979.75, and if I receive an answer of 80.93 hours I would like it rounded to 81 hours, or another example of 70.68 I would like rounded to the nearest quarter hour of 70.75. Is this possible?

    PS....I added spaces in my formula for Time as I kept getting an hourglass image for the word time when I post...<img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Thank you,
    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
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Rounding to Quarter Hour (Access 2003)

    The following should do what you are looking for:

    ROUND([ time ]/0.25,0)*0.25

    or

    ROUND( <img src=/S/time.gif border=0 alt=time width=32 height=48>/0.25,0)*0.25 <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

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

    Re: Rounding to Quarter Hour (Access 2003)

    For future reference: some words are converted to smileys when you enclose them in square brackets. To get around this, you can use <!t>[t]<!/t> and <!t>[/t]<!/t> around the word. For example, <!t>[time]<!/t> becomes <img src=/S/time.gif border=0 alt=time width=32 height=48> when you post it; to include <!t>[time]<!/t> in a post, use <!t>[t]<!/t>time<!t>[/t]<!/t>. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

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

    Re: Rounding to Quarter Hour (Access 2003)

    Thank you. I will try this after supper. When I have more <!t>[time]<!/t> <img src=/S/time.gif border=0 alt=time width=32 height=48> <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    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
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Rounding to Quarter Hour (Access 2003)

    Didn't work. Turned them all to 00.0 or 0.25.
    What could I be doing wrong? <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>
    It is not imperative (so I've been told since I asked this question) that it be rounded to quarter hour...so I may just leave it.
    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>

  6. #6
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Rounding to Quarter Hour (Access 2003)

    Did you round the Sum? My first reply should have been:

    ROUND(Sum(<!t>[TIME]<!/t>)*24/0.25,0)*0.25

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

    Re: Rounding to Quarter Hour (Access 2003)

    duh...i feel quite dumb on that one...no. Works fine. Thank you.
    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
  •