informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

dtsub()

The dtsub() function subtracts one datetime value from another. The result is an interval value.

Syntax

Usage

The dtsub() function subtracts the datetime value d2 from d1 and stores the interval result in inv. The result can be either a positive or a negative value. If necessary, the function extends d2 to match the qualifier for d1, before the subtraction.

Initialize the qualifier for inv with a value in either the year to month or day to fraction(5) classes. When d1 contains fields in the day to fraction class, the interval qualifier must also be in the day to fraction class.

Return Codes

0 The subtraction was successful.
<0 An error occurred while performing the subtraction.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved