#### DateTimeTo2000

##### DateTimeTo2000(Datetime, 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 retained as found in the Date field (19xx). If the 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 retained as found in the Date field (20xx).

  Note: If the year is less than or equal to 1899, and greater than or equal to 100, there will be no change to the date.

Parameters

- DateTime - Accepts only valid DateTime 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

- Here the window value is greater than the year, and so the year is changed to 20XX.

  `DateTimeTo2000(ToDateTime(1998, 12, 12, 3, 2, 1), 99)` - Returns 2098-12-12 3:02:01.

- Here the window value is less than the year, and so it will not change the year.

  `DateTimeTo2000(ToDateTime(1995, 1, 2, 3, 2, 1), 94)` - Returns 1995-01-02 3:02:01.

- These are examples of dates that will not be affected by this function.
  - `DateTimeTo2000(ToDateTime(1899, 12, 12, 5, 6, 7), 99)` - Returns 1899-12-12 5:06:07.
  - `DateTimeTo2000(ToDateTime(999, 12, 12, 5, 6, 7), 99)` - Returns 999-12-12 5:06:07.
- Some databases maintain the year of a Date as a two-digit field. These samples simulate that Date field.
  - `DateTimeTo2000(ToDateTime(93, 12, 12, 5, 6, 7), 96)` - Returns 2093-12-12 5:06:07.
  - `DateTimeTo2000(ToDateTime(98, 12, 12, 5, 6, 7), 50)` - Returns 1998-12-12 5:06:07.