General discussion

  • Creator
    Topic
  • #2288989

    Access – Round off to Hour

    Locked

    by borginva ·

    I have a query with these values:

    Field – Event time
    Table – Event
    Total – Group By

    and

    Field – Extra time
    Table – Event
    Total – Group By

    Now in the report it works off of:
    =([SumEvTime]+[SumExTime])

    Now it gives me total time in minutes.
    What can I do to it to make it convert to hours?

    All I can find in Access is:
    Syntax
    CONVERT(number,from_unit,to_unit)
    Number is the value in From_unit to convert.
    From_unit is a text value that specifies the units for Number.
    To_unit is a text value that specifies the units for the result.

    That is Chineese to me. No examples or anything.

    Please assist if you can.
    Thank you.
    God bless.

All Comments

  • Author
    Replies
    • #2712974

      Reply To: Access – Round off to Hour

      by borginva ·

      In reply to Access – Round off to Hour

      Oh, to nearest hour value. Thank you.

      And to correct a mistake:
      =([SumEvTime]+[SumExTime])
      is really
      =([Eventtime]+[extratime])

    • #2712973

      Reply To: Access – Round off to Hour

      by borginva ·

      In reply to Access – Round off to Hour

      Point value changed by question poster.

    • #2712909

      Reply To: Access – Round off to Hour

      by sgt_shultz ·

      In reply to Access – Round off to Hour

      sorry, borg, don’t kill me. it’s friday and a full moon. but…
      divide by 60?
      tell us what you are doing with the db?
      did you check out all free sample db’s on microsoft website? are you able to get into visual basic help? i assume yes because i see no examples for ’round’ function. but i think you are not rounding you are just figuring hours?

      • #3336909

        Reply To: Access – Round off to Hour

        by borginva ·

        In reply to Reply To: Access – Round off to Hour

        Ran into other situations and I am going to not bother with this anymore. Too much to figure how to make 37m come up correctly, for example, since that can not be a full 1h or even only .5.
        But the points you get.
        Thanks for answering.

    • #2712835

      Reply To: Access – Round off to Hour

      by sheryl v ·

      In reply to Access – Round off to Hour

      Use the datediff function
      =datediff(“h”,[Eventtime],[ExtraTime])
      This will return thedifference in hours and you can format the field to however many decimal points you need.

      • #3336910

        Reply To: Access – Round off to Hour

        by borginva ·

        In reply to Reply To: Access – Round off to Hour

        Ran into other situations and I am going to not bother with this anymore. Too much to figure how to make 37m come up correctly, for example, since that can not be a full 1h or even only .5.
        But the points you get.
        Thanks for answering.

    • #2703537

      Reply To: Access – Round off to Hour

      by borginva ·

      In reply to Access – Round off to Hour

      Sgt, do you mean db-mdbs? If so, no. I never checked the MS website for any. I can never find anything on that site. I even tried some Googling and nothing I found helpes. Must be the words I sue.
      I have no examples except that when using
      =[Eventtime+[extratime])
      It takes the 2 valus in the forms (set as minutes) and just adds them. Total minutes this report could be 7, could be 6.73. But I like them to be rounded up to the nearest hour. The 7 or 6.73 would both be rounded to 1h. 120m would become 2h.
      I checked the Access Help. What a waste. Gives me 2 worthless examples I do not understand.

    • #2703522

      Reply To: Access – Round off to Hour

      by borginva ·

      In reply to Access – Round off to Hour

      Maybe this may help form reading up on other examples that do not help me.
      Eventtime and extratime are not dates. They are fixed intergers. 1, 7, 9.46, 567.23, etc.

    • #2717219

      Reply To: Access – Round off to Hour

      by lauraburhans ·

      In reply to Access – Round off to Hour

      Format((([SumEvTime]+SumExTime])/60)/100,”Fixed”,0)*100

      • #3336908

        Reply To: Access – Round off to Hour

        by borginva ·

        In reply to Reply To: Access – Round off to Hour

        Ran into other situations and I am going to not bother with this anymore. Too much to figure how to make 37m come up correctly, for example, since that can not be a full 1h or even only .5.
        But the points you get.
        Thanks for answering.

    • #3336907

      Reply To: Access – Round off to Hour

      by borginva ·

      In reply to Access – Round off to Hour

      This question was closed by the author

Viewing 7 reply threads