ACC2000: SQL View Does Not Automatically Store Four-Digit Years (222459)
The information in this article applies to:
This article was previously published under Q222459 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SYMPTOMS
When you create a query by using the CreateQueryDef method in Visual Basic for Applications or by typing a SQL statement directly into the SQL View when Track name AutoCorrect info is turned off, date criteria entered as two-digit dates may not be resolved into four-digit dates when you save the query. This may result in the query returning different data sets on different computers, depending on the systems settings of the computer running the query.
CAUSE
Queries entered using the CreateQueryDef method or in the SQL View with Track name AutoCorrect info turned off are saved directly as text, and then evaluated at run-time. Two-digit dates entered as criteria under these conditions will be evaluated to four-digit dates based on the system settings of the computer running the query.
RESOLUTION
Enter your dates with a four-digit year, such as #4/19/1999# in a database or '4/19/1999' in a Microsoft Access project.
-or-
Create your queries using the Access Query By Example (QBE) grid in an Access database or the View Designer in an Access project.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. REFERENCESFor more information about Name AutoCorrect, click Microsoft Access Help on the
Help menu, type Name AutoCorrect in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.
Modification Type: | Major | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbbug kbpending KB222459 |
---|
|