Microsoft KB Archive/75455

= ACC2: Years Between 00 and 29 Are Interpreted as 1900 to 1929 =

Article ID: 75455

Article Last Modified on 1/9/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q75455



Novice: Requires knowledge of the user interface on single-user computers.



SYMPTOMS
When you enter dates by using two-digit years in Microsoft Access version 2.0, the year is always placed between 1900 and 1999.



CAUSE
Microsoft Access 2.0 assumes that all two-digit years are between 1900 and 1999.



RESOLUTION
When you enter dates in Access 2.0, enter the dates by using four-digit years.

You can resolve this problem in two different ways:
 * When you enter dates in Access 2.0, enter the dates by using four-digit years.


 * Download the update described in the &quot;Status&quot; section of this article.

NOTE: Please read the &quot;More Information&quot; section of this article for details on how installing the update affects two-digit date interpretation.



STATUS
Microsoft has confirmed that this is a problem in Microsoft Access 2.0. This problem is resolved by the Microsoft Access 2.0 Date Update.

To obtain the update, please see the following article in the Microsoft Knowledge Base:

231408 ACC2: Access 2.0 Two-Digit Date Update Available in Download Center



MORE INFORMATION
When you install the Access 2.0 Date Update described in the &quot;Status&quot; section, the following functionality will be updated or added to Access 2.0:
 * Access 2.0 will now support a 100 year sliding date window for the interpretation of dates.
 * Literal date values containing two-digit years stored in property sheets and the query design grid will be displayed as four-digit years.
 * Literal date values containing two-digit years entered into Access modules will be displayed as four-digit years.
 * Dates entered without a year will be interpreted as falling in the current year of the system clock.
 * Dates with two-digit years imported from text files will be interpreted as falling between 1930 and 2029.

Each of these topics is described in more detail in the following sections.

Access 2.0 Now Supports a Sliding Date Window
The 100 year sliding date window provides a range of years that defines where any given two-digit year falls. For example, if you have defined a 100 year sliding date window from 1930 to 2029, two-digit years between 00 and 29 will fall in the 2000s whereas two-digit years between 30 and 99 will fall in the 1900s. You add the setting for the sliding window for Access 2.0 in the Win.ini file. To add the setting to the Win.ini file, open the file in any text editor, such as Notepad, and add the following section:

[Microsoft Access 2.0]

In the new section, add the following setting:

TwoDigitYearMax = The maximum year in your window

For example, if you want to have a sliding date window from 1930 to 2029, add the following to the Win.ini file:

[Microsoft Access 2.0]

TwoDigitYearMax = 2029

If you do not set the value for the sliding date window, Access 2.0 will assume that two-digit years fall within the 1900s.

Two-Digit Years in Property Sheets and the Query Design Grid Will Be Displayed as Four-digit Years
When you enter date values or expressions that contain date values into property sheets or the query design grid, dates that contain two-digit years will be displayed according to the 100 year sliding date window. If you have not set the sliding date window as described in the &quot;Access 2.0 Now Supports a Sliding Date Window&quot; section, the dates will be displayed as falling between 1900 to 1999.

The following is a list of properties that you might enter dates into:

Table Properties:
 * ValidationRule

Table Field Properties:
 * DefaultValue
 * ValidationRule

Form Control Properties:
 * ControlSource
 * DefaultValue
 * ValidationRule

Report Control Properties:
 * ControlSource

Two-digit Years in Access Modules Will Be Displayed as Four-Digit Years
When you enter a literal date into a module, the date is stored as a double-precision, decimal value that represents a specific date. After the update is applied to a computer, literal dates containing two-digit years will be stored and displayed according to the sliding date window defined in the Win.ini file. Examples of literal dates in modules include:
 * Dates used in variable assignments (for example, MyDate = #1/1/96#).
 * Dates used in expressions (for example, If MyDate > #1/1/96#).
 * Dates used in constant assignments (for example, Const cMyDate = #1/1/96#).

Dates that are part of a string value are not literal dates and will not be changed from two-digit to four-digit years.

Dates Entered Without a Year Will Fall Within Current Year
This update fixes a problem in Access 2.0 that causes dates without years to return the incorrect system year if the system clock is set to the year 2000 or later.

Dates with Two-Digit Years Imported from Text Files Will Be Interpreted as Falling Between 1930 and 2029
When you import a text file that contains dates that have a two-digit year, the date is always considered as falling between 1930 and 2029. Dates imported from text files do not use the sliding date window defined by the Win.ini file. For additional information about importing text files with dates into Access 2.0, please click the article number below to view the article in the Microsoft Knowledge Base:

230593 ACC2: All Two-Digit Dates Imported from Text Resolved in 1900s

Important Information about Existing Dates in Your Database
When you install the Access 2.0 Date Update, the dates stored in your existing databases are not automatically converted from two-digit to four-digit dates. You must consider three important facts when using existing databases that contain dates in property sheets, the query design grid, or Access modules.
 * When you open Access objects that depend on a two-digit date, the dates will be displayed as four-digit years according to the sliding date window defined by the Win.ini file, but the dates will continue to be saved as two-digit dates.


 * To have property, query criteria, and query expression literal dates stored as four-digit dates based on the sliding date window, you must open the object in Design view and modify the actual property that contains the two-digit date.

For example, if you have a text box on a form with the ControlSource property set to the value = #1/1/90# - #1/1/89# in the your original database, you could cut the value out of the ControlSource property box (by pressing CTRL+X), and then paste the value back in (by pressing CTRL+V). When you save and close the form, the ControlSource property will be updated to contain the four-digit date.


 * Two-digit years that you entered into modules before you applied the update will have been resolved as occurring between 1900 and 1999 and will have been saved that way. Existing dates in modules will not change after you apply the update. Any dates that you enter after the update is applied will be resolved according to the sliding date window and will be saved as that date.

