ComponentOne True DBInput Pro 8.0
Compare Method (TDBDateX)

 

Reference> TDBDateX Object> TDBDateX Object Methods> Compare Method (TDBDateX)

Compare Method (TDBDateX)

The Compare method returns a 0 if the comparing dates are the same, 1 if the first date is greater than the second date, and 2 if the first day is smaller than the second date.

Syntax

object.Compare ([Date1], Date2)

Arguments

date1 is an optional Variant (Date), the first date time you want to use to compare. If not specified, the date time set in the Value property will be applied.

date2 is a required Variant (Date): the second date time you want to use to compare.

Return Value

This method can return any of these dbiCompareConst values:

0

date1 equals date2

1

date1 greater than date2

2

date2 greater than date1

Remarks

If the year part for date1 and date2 is omitted, Compare uses the current year from your system date.

If the date part for date1 or date2 is omitted, the date serial will be set to 0, which equals to Dec. 30, 1899. If the time part is omitted, the time serial will be also set to 0, which equals to 00:00:00.

If either date1 or date2 is set to Null, this method returns -1. If date1 is not specified, the date set in the Value property will be applied to the first date for comparing.

See Also

Match Method (TDBDateX)

InRange Method (TDBDateX)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback