SELECT rCustomer.*, rMachine.machCode
FROM rCustomer INNER JOIN rMachine ON rCustomer.HospitalID = rMachine.HospitalID
WHERE ((Not (rMachine.machCode) Is Null));
I've got 2 tables customer and machine, a customer CAN (doesn't have to) have many machines. So I want to single out the customers with machines using the above query. The problem is it gives a record for each machine so you get duplication of customers i.e.
Cust1 MachineA etc...
Cust1 MachineB etc...
Cust2 MachineA etc...
Cust3 MachineC etc...
The problem is I'm using the query to print labels out so I only need one label per customer. How do I refine the query to only show me one instance of the customer if they have a machine.
Thanks for any help in advance. R
FROM rCustomer INNER JOIN rMachine ON rCustomer.HospitalID = rMachine.HospitalID
WHERE ((Not (rMachine.machCode) Is Null));
I've got 2 tables customer and machine, a customer CAN (doesn't have to) have many machines. So I want to single out the customers with machines using the above query. The problem is it gives a record for each machine so you get duplication of customers i.e.
Cust1 MachineA etc...
Cust1 MachineB etc...
Cust2 MachineA etc...
Cust3 MachineC etc...
The problem is I'm using the query to print labels out so I only need one label per customer. How do I refine the query to only show me one instance of the customer if they have a machine.
Thanks for any help in advance. R