My Assistant
![]() ![]() |
|
|
Jul 13 2009, 08:06 AM
Post
#1
|
|
|
UtterAccess Member Posts: 43 |
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 |
|
|
|
Jul 13 2009, 08:16 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 17,644 From: Don Mills, ON (Canada) |
SELECT Field1, Field2, Field3
FROM MyTable WHERE DateDiff("d", [StartDate], [CancellationDate]) BETWEEN 14 AND 30 |
|
|
|
Jul 13 2009, 08:30 AM
Post
#3
|
|
|
UtterAccess Member Posts: 43 |
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? |
|
|
|
Jul 13 2009, 08:35 AM
Post
#4
|
|
|
UtterAccess VIP Posts: 17,644 From: Don Mills, ON (Canada) |
Sorry, no. I misread your criteria. Try:
SELECT Field1, Field2, Field3 FROM MyTable WHERE DateDiff("d", [StartDate], [CancellationDate]) BETWEEN -30 AND 14 |
|
|
|
Jul 13 2009, 08:45 AM
Post
#5
|
|
|
UtterAccess Member Posts: 43 |
Seems to work well, thanks.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 07:35 PM |