-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
(CInt(Format(Time(),"nn")) \ 15) + 1
Explanation:
Time() is an example time value. It is a VBA built-in function that
returns the current system Time. You would substitute the column name
that holds the time values.
The Format() function will get the minutes value ("nn" is the format
equivalent for minutes) from the time value. The minutes will be a
string data type.
The CInt() function converts the minutes from string data type to
integer data type - so we can perform mathmetical calculations on it.
The formula for finding the quarter hour of the minutes is:
(minutes \ 15) + 1
Here is the example result (from the Access Debug window):
? time
12:34:30 PM
? (CInt(Format(Time(),"nn")) \ 15) + 1
3
Since my system clock indicates minute 34, then the time is in the 3rd
quarter of the hour.
If you wanted that time in minutes you'd use this formula:
(CInt(Format(Time(),"nn")) \ 15) * 15
This rounds the value down to the closest 15th minute. E.g., if the
time was 12:34:30 PM, the formula would produce minute 30. So rounding
a complete time to the closest quarter hour:
CDate(Format(Time(),"hh") & ":" & _
Format((CInt(Format(Time(),"nn")) \ 15) * 15,"00"))
If Time = 12:34:30 PM, the above formula would yield 12:30:00 PM.
In a query substitute the name of the time column for the "Time"
function.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQi9gm4echKqOuFEgEQLR5QCgw/XGLT32BhHIUR6gVuKVj66Xsd0AoJVu
DsMZupF0F5tr7qIBZR9l1EPk
=vcLe
-----END PGP SIGNATURE-----