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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anniversary date in a query

Status
Not open for further replies.

penret

Technical User
Nov 14, 2003
13
US
SELECT CLIENT.PLAN_CODE, EMPLOYEE.[First Name], CLIENT.COMPANY, CLIENT.CONTACT, CLIENT.[CONSULTANT CONTACT], CLIENT.[CONSULTANT SALUTATION], CLIENT.STREET, CLIENT.CITY, CLIENT.STATE, CLIENT.ZIP, CLIENT.SALUTATION, EMPLOYEE.MI, EMPLOYEE.[Last Name], CLIENT.ANN, CLIENT.SPECIAL, CLIENT.[year of sale], CLIENT.STATUS, CLIENT.TYPE
FROM CLIENT INNER JOIN EMPLOYEE ON CLIENT.EE_CODE = EMPLOYEE.EE_Code
WHERE (((CLIENT.ANN) Like "12/31/**") AND ((CLIENT.SPECIAL) Is Null) AND ((CLIENT.[year of sale])<>2005) AND ((CLIENT.STATUS)="1") AND ((CLIENT.TYPE)<>"ps"))
ORDER BY EMPLOYEE.[First Name], CLIENT.COMPANY;

This is a mail merge query.
1. If Client Ann is like 12/31/** and Client Type is like PS then it runs fine.
2. If Ann is 12/31/** and Type is Not PS (as above)it has no records when merged.
3. If Ann is null and Type is Not PS it merges fine.

Thank you for any help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top