DB2DateTime.Compare(DB2DateTime db2DT1, DB2DateTime db2DT2) method
Determines whether one DB2DateTime instance value is earlier, later, or the same as another DB2DateTime instance value.
The DB2DateTime.Compare(DB2DateTime db2DT1, DB2DateTime db2DT2) method is available for use only with the Informix® database server.
- Namespace:
IBM.Data.DB2Types
- Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)
Syntax
[Visual Basic]
Public Shared Function Compare (db2DT1 As DB2DateTime, db2DT2 As DB2DateTime) As Int32
[C#]
public static Int32 Compare (DB2DateTime db2DT1, DB2DateTime db2DT2)
[C++]
public:
static Int32 Compare (DB2DateTime db2DT1, DB2DateTime db2DT2)
[JScript]
public static function Compare (db2DT1 : DB2DateTime, db2DT2 : DB2DateTime) : Int32
Parameters
- db2DT1
- The first of two DB2DateTime instances that you want to compare.
- db2DT2
- The second of two DB2DateTime instances that you want to compare.
Return value
An integer return value that
is based on the relative values of the db2DT1 DB2DateTime instance,
and db2DT2 DB2DateTime instance.
Value | Description |
---|---|
-1 | The value of the db2DT1 parameter is earlier than that of the db2DT2 parameter. |
0 | The value of the db2DT1 parameter is the same as that of the db2DT2 parameter. |
1 | The value of the db2DT1 parameter is later than that of the db2DT2 parameter. |
Remarks
You can compare any two DB2DateTime instances. Default values are used for any time units that are not specified in both the db2DT1and db2DT2 instances. See the DB2DateTime structure topic for the default values of various time units in the DB2DateTime structure.