[DUG] another set of eyes

Nicholas Barrett nick at opscentre.co.nz
Sun Jan 31 11:21:00 NZDT 2010


Hi Jeremy,

I'm not sure this solution has been given yet but this is what we use all
the time

WHERE (START_FIELD < END_RANGE) AND (END_FIELD > START_RANGE)

This will select all records who's START_FIELD and END_FIELD somehow
intersect the START_RANGE to END_RANGE.  There are six cases that we are
accounting for.  Four we want and two we don't.

SF < SR and EF < SR = FAIL
SF < SR and EF > SR = PASS
SF > SR and EF < ER = PASS
SF < ER and EF > ER = PASS
SF > ER and EF > ER = FAIL
SF < SR and EF > ER = PASS

The two fails are when the data does not intersect at all, the rest all
pass.

Hope that helps.

Cheers,

Nick Barrett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20100131/cac8a70b/attachment.html 


More information about the Delphi mailing list