When processing date literals (text values enclosed by "hash marks" #
) Access SQL will always interpret ambiguous xx-yy-zzzz
dates as mm-dd-yyyy
, regardless of the regional setting in place on the computer. So, if your machine is configured to display short dates as dd-mm-yyyy
and you create an Access query that uses #04-02-2014#
it will always be interpreted as April 2, not February 4.
The solution is to always format date literals as unambiguous yyyy-mm-dd
values. In your case, instead of
... VALUES (#" & BookingDate & "#" ...
you would use something like
... VALUES (#" & Format(BookingDate, "yyyy-mm-dd") & "#" ...