Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference DATETONUMBER
Functions and Expressions Reference Guide
84
DATETONUMBER
The DATETONUMBER function returns an integer that results from counting the
number of days from December 31, 1864, to the specified date.
Syntax
DATETONUMBER (single-date-expression)
Meaning
DATETONUMBER (date_to_convert)
Returns
This function returns a single-integer.
Converts a date to an integer. The resulting integer represents the number of
days since December 31, 1864, where using
DATETONUMBER with a date of
January 1, 1865 returns the integer value 1.
If the input argument is in error, the function returns the value NONE.
If the date format specified by the input argument does not include century,
the century is determined based on the Century map setting using the
CCLookup parameter or the current century.
Example
DaysBetween = DATETONUMBER ( StopDate ) DATETONUMBER (
StartDate )
This expression could be used in a map rule to produce a value for
DaysBetween. It converts the StopDate and the StartDate to integers, then
subtracts the resulting two integers, and returns the result as DaysBetween.
Uses
Use
DATETONUMBER to perform arithmetic on dates.
Related Functions
ADDDAYS, NUMBERTODATE