The SUBDUR operation can also be used to calculate a duration between:
The data types in factor 1 and factor 2 must be compatible types as specified above.
Factor 1 is required and must contain a Date, Time or Timestamp field, subfield, array, array element, constant or literal.
Factor 2 is required and must also contain a Date, Time or Timestamp field, array, array element, literal or constant.
The following duration codes are valid:
The result is a number of whole units, with any remainder discarded. For example, 61 minutes is equal to 1 hour and 59 minutes is equal to 0 hours.
The result field consists of two subfactors. The first is the name of a zero decimal numeric field, array or array element in which the result of the operation will be placed. The second subfactor contains a duration code denoting the type of duration. The result field will be negative if the date in factor 1 is earlier than the date in factor 2.
For more information on working with date-time fields see Date Operations.