NUMBERTODATE

You can use the NUMBERTODATE function to perform a calculation on a date.

NUMBERTODATE converts an integer to a date, where the integer is the number of days from December 31, 1864, to the specified date. Only positive, non-zero values can be specified as valid parameters.

.

Syntax:
NUMBERTODATE (single-integer-expression)
Meaning:
NUMBERTODATE (integer_to_convert)
Returns:
A single date

After converting an integer to a date, if the result is being assigned to a date object, the resulting date is in the presentation for that output. If the resulting date is not being assigned to an object, it has a CCYYMMDD presentation.

When the year exceeds four digits, the output will display hash characters (#) for the CCYY values because the field is defined to be only four digits in length.

Examples

  • NUMBERTODATE (StartDate)

    This example converts the StartDate value from an integer to a date that is in CCYYMMDD format.

Related functions

  • ADDDAYS
  • DATETONUMBER
  • FROMDATETIME
  • TODATETIME