Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding Minutes in Time Fields

Status
Not open for further replies.

scoombs

Technical User
Jan 31, 2005
11
GB
I want to round a field that has totaled time values for each day of the week,

I need the time to be rounded to 25 minute Intervals.

11.42 = 11.45
10.26 = 11.26 etc

Anyone have any clues?

Thanks.

Steve
 
to 25 minute Intervals : 10.26 = 11.26
???
 
I'm assuming that you mean quarter hour intervals rather than 25 minute intervals.

Output = (Round(4 * Input)) / 4

traingamer
 
Or if you're dealing in hours and minutes, expressed as a decimal i.e. 2.45 = two hours 45 minutes or 3.28 = 3 hours 28 minutes:

hours quarter hours

Output = Int(Input) + ((Round((Input - Int(Input)) * 400 / 60)) * 15) / 100

traingamer
 
Actually that's not quite right either, as 3.58 will round to 3.6 rather than 4.0, but it should give you a push in the right direction.

traingamer
 
Howdy All . . . . .

PHV said:
[blue][tt] to 25 minute Intervals : 10.26 = 11.26
: 11.42 = 11.45[/tt][/blue]
Until [blue]scoombs[/blue] qualifies his/her intent, were really hunting in the dark! Besides . . . for the moment it appears were talking to oueselves ;-)

Calvin.gif
See Ya! . . . . . .
 
. . . for the moment it appears were talking to oueselves

But we get intelligent conversation that way [dazed]

traingamer
 
Sorry guys,

I did mean 11.26 = 11.25
1.04 = 1.00

Thanks,

You have clarrified the answer!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top