473,394 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

date format apparently changing mid-program

Hi everyone

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
  1. CurrentDb.QueryDefs("crosstab filtered").SQL = strSQL
I can then use this query as the recordsource for my report, etc etc etc.

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
Jul 28 '08 #1
3 1791
missinglinq
3,532 Expert 2GB
Allen Browne has an excellent article on this problem. Hopefully it'll help you with yours!

http://allenbrowne.com/ser-36.html

Linq ;0)>
Jul 28 '08 #2
Thank you so much - that was really helpful!
Jul 29 '08 #3
NeoPa
32,556 Expert Mod 16PB
What that doesn't explain clearly is how the SQL specific standard interferes with this too (from what you say this is particularly relevant to your situation). See Literal DateTimes and Their Delimiters (#) for a fuller explanation.
Aug 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bruce Cushman | last post by:
My DB is Access 2000 based "possibly written in 2002" and I have to send and receive update files, ported to a UNIX server by FTP, DB unknown. The file content uses a fixed length string, zero...
4
by: Annie D via AccessMonster.com | last post by:
Problem! I have a series of CSV files that I am bringing in to Access, contained within each of them are 6 date fields, however, they are not being recognized as dates…this is a big problem!...
21
by: rdemyan via AccessMonster.com | last post by:
Is there a way to get the internet date/time. I saw an article that uses WinSock, but WinSock doesn't seem to be available in Access. I want to verify that the date/time on the local PC running...
3
by: levinepw | last post by:
I can convert a yymmdd to (yymmdd - 1 day) What I do is take the existing yymmdd string, convert it to a mm/dd/yyyy date and subtract a day from it & then format it back into yyymmdd. But the...
6
by: Robert Bravery | last post by:
HI all, I'm new toJS. I am trying to get a user inputed date into mysql. The mysql database accepts the date in yyyy-mm-dd format. The user, from South Africa inputs the date in a web form in...
5
by: mabond | last post by:
Hi Having trouble filling a datetime filed in SQL table with a value from an array. The original source is a comma-delimited text file where the date and time values are in two columns. I...
1
by: Beckster6701 | last post by:
I have a MSAccess database that is linked to a SQL server. I cannot change the SQL server datatype as I am not the only one that uses the database. I'm trying to convert the text field to a valid...
21
by: Darin | last post by:
I have an applicatoin that works 100% perfect when running on a machine setup for English (United States), but when I change it to Spanish (Mexico), the dates start giving me fits. THe reason is...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
5
by: servantofone | last post by:
I have dates in the format of YYYMMDD that I would like to convert into an actual date. The first digit indicates that the date is after 2000 if it is a 1 and prior to 2000 if it is a 0. So for...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.