DT Functions: Converting an Integer to a Date

How to:

There are six DT functions; each one converts a number into a date of a different format.


Top of page

x
Syntax: How to Convert an Integer to a Date
						function(number, output)

where:

function

Is one of the following:

DTDMY converts a number to a day-month-year date.

DTDYM converts a number to a day-year-month date.

DTMDY converts a number to a month-day-year date.

DTMYD converts a number to a month-year-day date.

DTYDM converts a number to a year-day-month date.

DTYMD converts a number to a year-month-day date.

number

Integer

Is the number of days since the base date, possibly received from the functions DAxxx.

output

I8xxx, where xxx corresponds to the function DTxxx in the above list.



Example: Converting an Integer to a Date

DTMDY converts NEWF (which was converted to the number of days by DAYMD) to the corresponding date and stores the result in a column with the format I8MDYY.

DTMDY(NEWF, 'I8MDYY')

For 81/11/02, the result is 11/02/1981.

For 82/05/01, the result is 05/01/1982.


iWay Software