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

I want to compare and display the results of 2 queries

Status
Not open for further replies.

tforrest79

Technical User
Joined
Mar 6, 2008
Messages
3
Location
GB
Hi I have 2 queries

1. customers where movement date is >= 01/04/06
2. customer where order date is >= 01/04/06

The 2 queries are based on the same table however as you can see in the title states that each query has different criteria.

1 .customers where movement date is >= 01/04/06 has 1502 records

2. customer where order date is >= 01/04/06 has 1486 records.

Ive applied a distinct to each query above to identify indivual customers. I get two different results and would now like to understand how I can compare the results by my customer reference field as both tables have this field.

I want to list any customers that do not match. This will tell me what customers have ordered a products from me since 1st apr 2006 but the product has not actually moved.

Hope you can help.

Kind regards,
Tom
 
Select *
from qryOrderyDate
left join qrymovementdate
on qryOrderyDate.customerid=qrymovementdate.customerid
where qrymovementdate.customerid is null
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top