DMY, MDY, YMD: Calculating the Difference Between Two Dates

How to:

The DMY, MDY, and YMD functions calculate the difference between two legacy dates in integer, alphanumeric, or packed format.


Top of page

x
Syntax: How to Calculate the Difference Between Two Dates
						function(from_date, to_date)

where:

function

Is one of the following:

DMY calculates the difference between two dates in day-month-year format.

MDY calculates the difference between two dates in month-day-year format.

YMD calculates the difference between two dates in year-month-day format.

from_date
I, P, or A format with date display options.

Is the beginning legacy date.

to_date
I, P, or A format with date display options.I6xxx or I8xxx where xxx corresponds to the specified function (DMY, YMD, or MDY).

Is the end date.



Example: Calculating the Number of Days Between Two Dates

YMD calculates the number of days between the dates in HIRE_DATE and DAT_INC.

YMD(HIRE_DATE, DAT_INC)

iWay Software