The TEST-DATE-YYYYMMDD function tests the validity of a date in standard date form (YYYYMMDD) against the Gregorian calendar.

- Argument-1 must be an integer.

- The possible values returned by this function are:
- 0 - the date is valid.
- 1 - the date is outside of the date range 1601-9999; that is, the value of argument-1 is less than 1601000 or greater than 9999999; therefore, .
- 2 - the month is not within the range 1-12; that is, the value of FUNCTION MOD (argument-1 10000) is less than 100 or greater than 1299
- 3 - the day is not valid in the given year and month; that is, the value of FUNCTION MOD (argument-1 100) is less than 1 or greater than the number of days in the month determined by FUNCTION INTEGER (FUNCTION MOD (argument-1 10000)/100) of the year determined by FUNCTION INTEGER (argument-1/10000) .