#### DateTo2000

##### DateTo2000(date, number)

- 2 digit years(xx)
  If the Year value is greater than the windowing number, 19 is appended before the 2 digits (19xx). If the Year value is less than or equal to the windowing number, 20 is appended (20xx).
- 4 digit years(19xx)
  If the last two digits in the Year value are greater than the windowing number, the Year is preserved as found in the date field (19xx). If the last two digits in the Year value are less than or equal to the windowing number, the first two digits are changed to 20 (20xx). If the first two digits in the year field are 20, the Year is preserved as found in the date field (20xx).

Parameters

- date - Accepts only valid Date fields, with either 2 digit or 4 digit years.
- number - A number between 0 and 99 corresponding with the desired windowing year.

Return value

A Date field with a four digit year.

Examples

- `DateTo2000(ToDate(1993,12,12), 99)`- Returns 2093/12/12 because the window value is greater than the year, and so the date will be changed to 20XX.
- `DateTo2000(ToDate(1993,12,12), 92)`- Returns 1993/12/12 because the window value is less than the year, and so the year will not be changed.
- This is an example of a date that is not affected by this function:

  `DateTo2000(ToDate(1899,12,12), 99)`- Returns 1899/12/12.

- This is an example of a date that is not affected by this function.

  `DateTo2000(ToDate(100,12,12), 99)`- Returns 100/12/12.

- Some databases maintain the year of a date as a two-digit field. The following simulates this type of date field.
  - `DateTo2000(ToDate (98,12,12), 99)`- Returns 2098/12/12.
  - `DateTo2000(ToDate (98,12,12), 97)`- Returns 1998/12/12.
  - `DateTo2000(ToDate (9,12,12), 10)`- Returns 2009/12/12.
  - `DateTo2000(ToDate (1,12,12), 0)`- Returns 1901/12/12.

Notes:

- If the year is less than or equal to 1899 and greater or equal to 100, there will be no change to the date.
- Whether your database dates are interpreted as two digit years or 4 digit years (19xx) is dependent on the database driver you are using. The result of the formula will be the same in either case.