Like the sound of the logic, however the code doesn't run on SQL2K as the Max (and therefore Min) functions only take the one parameter and so is not running :(
-----Original Message----- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Monday, June 9, 2003 14:26 To: CF-Talk Subject: Re: 0ut 0f 0ffice Dates How about checking that the number of days somebody is OOO is equal to the number of days between now and the deadline? If that serves your purpose, use the query below (check the datediff syntax, I don't use non-standard date functionality very often). SELECT SUM(DateDiff("d",MAX(OutOfOfficeFrom, @Now),Min(OutOfOfficeTo, @DeadLine))) FROM OutOfOffice WHERE UserID = @UserID AND ( (OutOfOfficeTo BETWEEN @Now AND @DeadLine) OR (OutOfOfficeFrom BETWEEN @Now AND @DeadLine) ) Jochem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4