I've come across some perculiar behaviour in a little database app I'm making with Access.
I have a form for users to create a filter for data that goes into a cross-tab query. One of the filters is by date - users can choose a start month and an end month. From this, I construct a string - something like "between #1/7/2008# and #31/7/2008#" - which I then use as a where condition in the sql statement needed to generate the cross-tab query.
I have a query called "crosstab filtered", and I change the sql for this with
Expand|Select|Wrap|Line Numbers
- CurrentDb.QueryDefs("crosstab filtered").SQL = strSQL
The problem is that when I inspect my query, the date format for the first date has switched. Instead of, for example, "between #1/7/2008# and #31/7/2008#", I have "between #7/1/2008# and #31/7/2008#".
I have checked in the control panel, and date format is the European format - day/month/year - which is what I want. I have also checked how Access displays dates - Now() also gives the date in European format.
I have no idea where my probelm is, so any ideas would be most useful!
Cheers,
Peter
Luganville, Vanuatu