I currently store a duration field in the form ex) 1.64 hours. In my report I would like to display it in hrs. and minutes. What is the best approach to do this. Thanks.
This is handled by creating two fields out of one. You may make the change either in:
1. The table itself--add field "hours" and field "minutes".
2. A query in which you calculate the calculated values "hours" and "minutes".
3. Inside the report itself, you can set the control source of a textbox to "=[calculations]"
To get hours:
Hours = Fix([duration_field_name])
To get minutes:
Minutes = ( ([duration_field_name] - Fix([duration_field_name]) ) * 60
Well, one tenth of an hour is six minutes. One HUNDREDth of an hour is 36 seconds. I guess what you probably want to do is multiply the fractional part of the DURATION by 36
64 * 36 = 2304
convert that to whole minutes
2304 / 60 = 38.4
and then decide if you want to round up or down the .4 remainder.
1.64 hours = 1 hour, 38 minutes, and 4 tenths of a minute, if I did the math correctly.
Jim
Me? Ambivalent? Well, yes and no....
Another free Access forum:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.