Ok, I now have
DECLARE @Now AS DateTime
DECLARE @DeadLine AS DateTime
DECLARE @UserID AS Int
SET @Now = {d '2003-05-15'}
SET @Deadline = {d '2003-05-25'}
SET @UserID = 6
SELECT *
FROM OutOfOffice
WHERE UserID = @UserID
AND (
(OutOfOfficeTo BETWEEN @Now AND @DeadLine)
OR
(OutOfOfficeFrom BETWEEN @Now AND @DeadLine)
)
Which gets me all OOO periods between 2 dates, what I need to do now is
check that if there is more than one, that the dates are sequential is this
possible? Or should I do the processing on the CF side?
-----Original Message-----
From: Mike Townend [mailto:[EMAIL PROTECTED]
Sent: Monday, June 9, 2003 13:25
To: CF-Talk
Subject: RE: 0ut 0f 0ffice Dates
It was sent to cf-sql..
We're using SQLServer 2K
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Get the mailserver that powers this list at
http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4