Friday, November 18, 2011

邏輯: Check Date Range 重疊

(StartDate1 <= EndDate2) and (StartDate2 <= EndDate1)

Reference



( start1 <= end2 and start2 <= end1 )
If TRUE, then the ranges overlap.

Reference 2


Important Assumption 假設:
This assumes that start date <= end date in each range. Thiscan also be stated as...
( start1 <= end1 and start2 <= end2 )


Applicability 適用:
Is not limited to date/time comparisons; can also be used for ranges of numbers, names, and any other data type where ranges are meaningful.

No comments:

Post a Comment