I won’t bore you with the details, but I am able to prove that using the DateAdd() function with the “h” option is not always precise!
You can verify this yourself. In the Immediate Window just enter this:
?DateAdd(“h”,1,#08:00#) = #09:00#
This adds 1 hour to 8:00am and compares the result to 9:00am. As expected, this returns TRUE. But then try this:
?DateAdd(“h”,2,#08:00#) = #10:00#
This returns FALSE!
But wait, it gets better! I had populated a table of TimeSlots using an append query that utilized the DateAdd function. The PrimaryKey was the TimeSlot field, which was a Date/Time field. In looking at the table, there was an entry for 10:00am. I could manually add another record for 10:00am, so that now my table shows 2 records at 10:00am (the Primary Key)! Actually, I even expanded the formatting to show 10:00:00am for both cases.
Just so you won’t think this is insignificant, I discovered this when I wrote a query to return all TimesSlots >=#10:00#. The 10:00am timeslot was NOT returned, it started at 10:15am.