General discussion

Locked

Access - Round off to Hour

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.

This conversation is currently closed to new comments.

11 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by BorgInva In reply to Access - Round off to Hou ...

Oh, to nearest hour value. Thank you.

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

Collapse -

by BorgInva In reply to Access - Round off to Hou ...

Point value changed by question poster.

Collapse -

by sgt_shultz In reply to Access - Round off to Hou ...

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?

Collapse -

by BorgInva In reply to

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.

Collapse -

by Sheryl V In reply to Access - Round off to Hou ...

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.

Collapse -

by BorgInva In reply to

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.

Collapse -

by BorgInva In reply to Access - Round off to Hou ...

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.

Collapse -

by BorgInva In reply to Access - Round off to Hou ...

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.

Collapse -

by lauraburhans In reply to Access - Round off to Hou ...

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

Collapse -

by BorgInva In reply to

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.

Back to Software Forum
11 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums