Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query by date excluding particular months

Status
Not open for further replies.

Shilohcity

Technical User
Jul 12, 2000
136
GB
Hi there

I have a range of data I am trying to query based upon all sorts of things but one particular part is that it must not have date between 23 April 2001 and 5 July 2001.

I have everything working except the date part and Im, not really sure where to start with this. I guess I need to group by date and then use a not like the date range but it doesnt seem to work.

Anyway my query so far:

SELECT dbo_Customer.EMail_Addr, dbo_Customer_Sector.Flight_Date
FROM dbo_Customer INNER JOIN dbo_Customer_Sector ON dbo_Customer.Customer_No = dbo_Customer_Sector.Customer_No
GROUP BY dbo_Customer.EMail_Addr, dbo_Customer_Sector.Flight_Date, dbo_Customer.Country, dbo_Customer.EMail_Subscriber
HAVING (((dbo_Customer.EMail_Addr)<>&quot;&quot;) AND ((dbo_Customer.Country) Like &quot;n*&quot;) AND ((dbo_Customer.EMail_Subscriber)=&quot;Y&quot;));


All help is most appreciated.

Justin.X-)
&quot;Creativity is the ability to introduce order into the randomness of nature.&quot; Eric Hoffer

Visit me at
 
well for the example above why not add something like

WHERE dbo_Customer_Sector.Flight_Date > '5-Jul-2001' or
dbo_Customer_Sector.Flight_Date < '23-Apr-2001' Ben
+61 403 395 052
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top