View Full Version : Date format


Vulcan1500
01-13-2008, 01:03 PM
Using MS Access I have the following SQL for a selection query:

SELECT qryOfferteAfdruk.pkOfferte, qryOfferteAfdruk.Nummer, qryOfferteAfdruk.Datum, qryOfferteAfdruk.Bedrijfsnaam FROM qryOfferteAfdruk WHERE [qryOfferteAfdruk.Datum] Between #08-01-2008# And #12-01-2008# ORDER BY qryOfferteAfdruk.pkOfferte DESC

The problem is that the 'between' dates should have dd-mm-yyyy format, but once the query is executed the format is mm-dd-yyyy. I do not understand why, because in the control panel of Windows I selected dd-mm-yyyy and in MS Access I selected the standard date format, being dd-mm-yyyy.:confused:

RuralGuy
01-13-2008, 01:33 PM
See if this link (http://allenbrowne.com/ser-36.html) helps a bit.

Vulcan1500
01-14-2008, 04:56 AM
Thanks RuralGuy! Format([Date], "dd-mm-yyy") did the trick.

RuralGuy
01-14-2008, 06:24 AM
Outstanding! Those various date formats can drive you bonkers until you understand what is going on. Thanks for posting back with your success.