It may be easiest to set up a lookup table with the 48 entries. It would
have 2 columns, the first column would have 1 through 48, the second would
have the times of each half hour. You would then find the value in column 1
associated with the maximum value in column 2 that is equal to or less than
the time you are testing.
Example:
DLookup("Field1", "tblHalfHourLookup", "Field2 = #" & DMax(""Field2"",
""tblHalfHourLookup"", ""Field2<= #"" & [TimeField] & ""#"") & "#")
--
Wayne Morgan
MS Access MVP
<sp***********@gmail.com> wrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
I am trying to take standard MS Time:
2/22/2006 8:56:37 AM (stored in MS Decimal Format)
and convert it to the half hour of the day it occurred in:
2/22/2006 8:56:37 AM would be in the 18th half hour of the day (48 in
all).
Anyone know of a way to do this within a query?
I have tried this:
Fix(0.999999+(Time()-[TimeField])*24)
and all it returns is the actual half hour of the year, I believe.
Thanks in advance,
Dave