UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Find records from date criteria    
 
   
famico78
post 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
Go to the top of the page
 
+
Doug Steele
post 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
Go to the top of the page
 
+
famico78
post 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?
Go to the top of the page
 
+
Doug Steele
post 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
Go to the top of the page
 
+
famico78
post Jul 13 2009, 08:45 AM
Post #5

UtterAccess Member
Posts: 43



Seems to work well, thanks.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 25th May 2013 - 07:35 PM