ifjzettner
New member
- Local time
- Today, 10:56
- Joined
- May 11, 2013
- Messages
- 8
Hello all,
Thanks for opening my thread.
I'm calculating total times in a query, based on the start time, the end time and the total time, which is simply end time minus start time.
What I wish to achieve: if the minutes show 0-9, round down to the nearest hour. Else, round up to the nearest hour. So 13:01 returns 13, 13:10 returns 14.
So far, I have:
[start_time]
[end_time]
[total_time]
I need:
[rounded_time]
I get total time by this method:
total time: CDate(IIf([start_time]<[end_time];[end_time]-[start_time];(#23:00:00#+#1:00:00#)-([end_time]-[start_time])))
I have a basic understanding of rounding, this below works:
rounded_time: Round(([end_time]-[start_time])*24)
This above returns the hour only, and rounds 13:29 to 13 and 13:31 to 14.
I tried experimenting with IIf, CDate and minutes, but failed so far.
Thank you for your suggestions.
Best wishes,
Tamas
Thanks for opening my thread.
I'm calculating total times in a query, based on the start time, the end time and the total time, which is simply end time minus start time.
What I wish to achieve: if the minutes show 0-9, round down to the nearest hour. Else, round up to the nearest hour. So 13:01 returns 13, 13:10 returns 14.
So far, I have:
[start_time]
[end_time]
[total_time]
I need:
[rounded_time]
I get total time by this method:
total time: CDate(IIf([start_time]<[end_time];[end_time]-[start_time];(#23:00:00#+#1:00:00#)-([end_time]-[start_time])))
I have a basic understanding of rounding, this below works:
rounded_time: Round(([end_time]-[start_time])*24)
This above returns the hour only, and rounds 13:29 to 13 and 13:31 to 14.
I tried experimenting with IIf, CDate and minutes, but failed so far.
Thank you for your suggestions.
Best wishes,
Tamas