Calculate and round minutes

dfishfan

New member
Local time
Today, 15:17
Joined
Jul 9, 2010
Messages
7
Need to update a time calculation field, if minutes are from 0 to 6 then make minutes 0, if 6 to 16 then make 10 and so on.

Cant seem to find anything on this. This is for a pay calculation table.

thanks
 
Your example is not mathematically sound. 0-6 averages to 3, 6-16 averages to 11. Can you explain a full minute so I can see if the answer involves math.
Otherwise, take the minutes away from your data/time record and use a case statement to tack on whatever minutes you want.
 
I think dfishfan is calculating for extra hours, so if they worked 5 minutes extra they get nothing, if they worked an extra 6 to 15 minutes, they get 10 of their hourly rate. Like Privateer said, use a Select Case statement.
 
Yes VBAINet, you have my problem exactly, but i am still needing a little help. I am still learning some vb techniques and all.

What i have is a datediff function that finds the time elapsed between start and end time and stores it in minutes. I convert the minutes to hours. ?What i have to do is then take the minutes from the hour field and if the minutes fall into certain ranges then i need to change the minutes to the new value. ie. 0 to 6 becomes 0, 6 to 15.9 is 10, 16 to 25.9 is 20 and so on till 60 minutes.

Not sure at all how to do this. Any help much appreciated.
 

Users who are viewing this thread

Back
Top Bottom