A
ApeX
I got a question about checking if the periods overlap when inserting
new row with two datetime objects TS and TE :
BS - Existing period start
BE - Existing period end
TS - New period start
TE - New period end
i know i could just use
****************************
return !((TS < BS && TE < BS) || (TS > BE && TE > BE));
*********************************
to see if they overlap and return if they don't or do, but the problem
is that the TE period can be NULL,
and when inserting new TS when there already exists a BS with a NULL
BE, the code breaks because of the NULL date in the IF clause.
Thanx!
new row with two datetime objects TS and TE :
BS - Existing period start
BE - Existing period end
TS - New period start
TE - New period end
i know i could just use
****************************
return !((TS < BS && TE < BS) || (TS > BE && TE > BE));
*********************************
to see if they overlap and return if they don't or do, but the problem
is that the TE period can be NULL,
and when inserting new TS when there already exists a BS with a NULL
BE, the code breaks because of the NULL date in the IF clause.
Thanx!