How to: |
Given two dates in standard date or date-time formats, DTIFF returns the number of given component boundaries between the two dates. The returned value has integer format for calendar components or double precision floating point format for time components.
DTDIFF(end_date, start_date, component)
where:
Date or date-time
Is the ending date in either standard date or date-time format. If this date is given in standard date format, all time components are assumed to be zero.
Date or date-time
Is the starting date in either standard date or date-time format. If this date is given in standard date format, all time components are assumed to be zero.
Keyword
Is the component on which the number of boundaries is to be calculated. For example, QUARTER finds the difference in quarters between two dates. Valid components (and acceptable values) are:
DTDIFF calculates employee age when hired:
DTDIFF(START_DATE, DATE_OF_BIRTH, YEAR)
For the date of birth 1991/06/04 and the start date 2008/11/14, the result is 17.
iWay Software |