Microsoft KB Archive/187699

= Query98: MSQuery Uses 1900 Date When Two Digits Are Used for the Year =

Article ID: 187699

Article Last Modified on 9/11/2002

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh
 * Microsoft Query 2000

-



This article was previously published under Q187699





SYMPTOMS
When you perform a query in Microsoft Query 98 Macintosh Edition, and you use two digits for a year in the criteria, Microsoft Query may return records that meet criteria other than the criteria you specify.



CAUSE
When you use two digits for a year in the criteria pane, Microsoft Query always assumes by design that the year is between 1900 and 1999. This behavior occurs for dates that you enter in the value field of the Criteria pane and for dates that you use in parameter queries.



WORKAROUND
To retrieve dates outside the years 1900-1999, use four digits for the year in the query.



STATUS
This behavior is by design of Microsoft Query 98 Macintosh Edition.



MORE INFORMATION
If two records have the following two values in a date field

1/1/1919

1/1/2019

and you use #1/1/19# in the criteria pane of Microsoft Query, only the record containing the value 1/1/1919 is returned. If you change the criteria to #1/1/2019#, the record containing the value 1/1/2019 is returned.

This behavior is different from the behavior in Microsoft Excel 98 Macintosh Edition. In Excel 98, if you use two digits for any years between 0 and 29 (inclusive), the date is assumed to be 2000 to 2029. If you use two digits for years between 30 and 99 (inclusive), the date is assumed to be 1930 to 1999.

If you insert or update records using the Data pane in Microsoft Query, you should also use four-digit years for dates you enter. Otherwise, Query will assume any two-digit years are between 1900 and 1999.

