Hi
I have a table that contains different transaction types for customers and I am looking for a list of customers that does not have a particular transaction type. What I have and it works, is one query that gives me all the customers from that table that have that transaction type and then I have another query that uses that first query with a right join and an Is Null criteria on the linked field to give me those customers that don't have that transaction type. Question : Is there a way of combining these two queries into one sql statement? The two queries are as follows
first query, called CustomersInvoiced:
SELECT CustomersActivity.[cl::code], CustomersActivity.[sbt::typ]
FROM CustomersActivity
WHERE (((CustomersActivity.[sbt::typ])=1));
second query:
SELECT CustomersActivity.[cl::code]
FROM CustomersInvoiced RIGHT JOIN CustomersActivity ON CustomersInvoiced.[cl::code] = CustomersActivity.[cl::code]
WHERE (((CustomersInvoiced.[cl::code]) Is Null))
GROUP BY CustomersActivity.[cl::code];
Any help greatly appreciated
I have a table that contains different transaction types for customers and I am looking for a list of customers that does not have a particular transaction type. What I have and it works, is one query that gives me all the customers from that table that have that transaction type and then I have another query that uses that first query with a right join and an Is Null criteria on the linked field to give me those customers that don't have that transaction type. Question : Is there a way of combining these two queries into one sql statement? The two queries are as follows
first query, called CustomersInvoiced:
SELECT CustomersActivity.[cl::code], CustomersActivity.[sbt::typ]
FROM CustomersActivity
WHERE (((CustomersActivity.[sbt::typ])=1));
second query:
SELECT CustomersActivity.[cl::code]
FROM CustomersInvoiced RIGHT JOIN CustomersActivity ON CustomersInvoiced.[cl::code] = CustomersActivity.[cl::code]
WHERE (((CustomersInvoiced.[cl::code]) Is Null))
GROUP BY CustomersActivity.[cl::code];
Any help greatly appreciated