select count(*) as overlapping from promotions where

enddate >= #form.startdate#

and

startdate <= #form.enddate#

after running this query the "overlapping" column should tell you how
many existing promotions overlap the dates provided in the form...


You have, essentially 4 conditions


existing overlaps entire new promotion
|-- overlapping --|
   |-- new --|


new promotion overlaps entire existing promotion
   |-- overlapping --|
|-- new               --|

new promotion overlaps end of existing promotion
|-- overlapping --|
            |-- new --|

new promotion overlaps beginning of existing promotion
   |-- overlapping --|
|-- new --|

In all 4 conditions, the startdate of the new promotion is less than
or equal to (^left of) the end date of the existing promotion _and_
the enddate of the new promotion is greater than or equal to (^right
of) the start date of the existing promotion -- hence your 2 filters.


s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:213848
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to