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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restating Question:

Status
Not open for further replies.

NewTeki

Technical User
Jul 16, 2003
22
US
Does anyone know how to round time to the nearest Quarter Hour?
 
Here are two functions I just wrote:
Function Qtr(intMinutes As Integer) As Integer
Qtr = Round((intMinutes + 7) / 15, 0)
End Function

Function QtrHr(dtmTime As Date) As Integer
QtrHr = Round((Format(dtmTime, "n") + 7) / 15, 0)
End Function

I don't deal a lot with time, so there may be things I'm missing here, but my testing showed them to produce the results I was expecting.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top