famico78
Jul 13 2009, 08:06 AM
I am looking to create a list of all the services in June which have been cancelled 14 days after the startdate of a service and up to 30 days before the startdatedate of the service.
I have a 'startdate', 'enddate' and 'cancellationdate' fiieds.
Please help
Doug Steele
Jul 13 2009, 08:16 AM
SELECT Field1, Field2, Field3
FROM MyTable
WHERE DateDiff("d", [StartDate], [CancellationDate]) BETWEEN 14 AND 30
famico78
Jul 13 2009, 08:30 AM
So the above will give me those that have been cancelled up to 14 days after the start date
AND
Those up to 30 days before the start date?
Doug Steele
Jul 13 2009, 08:35 AM
Sorry, no. I misread your criteria. Try:
SELECT Field1, Field2, Field3
FROM MyTable
WHERE DateDiff("d", [StartDate], [CancellationDate]) BETWEEN -30 AND 14
famico78
Jul 13 2009, 08:45 AM
Seems to work well, thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.