Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Round time to the closest half hour -access 2000

Posted on 2008-06-19
3
Medium Priority
?
404 Views
Last Modified: 2008-06-19
I have an attendance database and I need to round 'OUT" time to the closest hour. And then calculate overtime based on the 'End Time' (the time an employee should officially leave) and the OUT time (rounded):

Example:
Time Out   Round time  
 
4:10            4:00
4:55            5:00
4:25            4:30  

This is the formula I have in my query to calculate the overtime:

 DateDiff("n",[End Time],[OUT])/60,0) AS OT

0
Comment
Question by:cpasula
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Expert Comment

by:Flyster
ID: 21826774
Will this work gor you?

Round Time: IIf(Minute([Time Out])<15,TimeSerial(Hour([Time Out]),0,0),IIf(Minute([Time Out])<45,TimeSerial(Hour([Time Out]),30,0),TimeSerial(Hour([Time Out])+1,0,0)))

Flyster
0
 

Author Comment

by:cpasula
ID: 21826872
fLYSTER

Your formula is working perfect to round the time. But how can I do it so my overtime 'OT' (overtime)  is also rounded. This is the formula I currently have:

DateDiff("n",[End Time],[OUT])/60,0) AS OT

0
 
LVL 22

Accepted Solution

by:
Flyster earned 500 total points
ID: 21826944
Can't you use Round Time instead of OUT?

DateDiff("n",[End Time],[Round Time])/60,0) AS OT
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question