Query HELP !!

  • Thread starter Thread starter blake7
  • Start date Start date
B

blake7

Hi all, I have a table with columns as below and want to create a query as
shown at the bottom, can anyone help, thanks in advance. Tony

PRODUCT FAULT TYPE
iron customer complaint
television ok
telephone warranty
iron internal issue
iron health & safety
iron ok
iron warranty
iron ok
iron internal issue
television ok
telephone Warranty

What I want to see:

PRODUCT FAULT TYPE TOTAL
Iron customer complaint 1
Ok 2
internal issue 2
warranty 1
health & safety 1

television ok 2
telephone warranty 2
 
On Wed, 29 Oct 2008 07:15:01 -0700, blake7

Use a Totals query. Something like:
select Product, FaultType, Count(Product)
from MyTable
group by Product, FaultType

Btw, I hope this is not really your table, or it would be a really bad
table design.

-Tom.
Microsoft Access MVP
 
First things first, your tables need to be fixed. It looks like your tables
actually have "iron, telephone, etc" as its column names which is incorrect.

Products
----------
ProductsID
Product

Faults
-------
FaultID
FaultType

ProductFault
--------------
ProductFaultID
ProductID
FaultID

If you use the query wizard and built your query based on: the ProductName
from the Products table, FaultType from the Faults table, FaultsID from
ProductFault table. In the query edit view Group by ProductName, FaultType
and set FaultsID to Count.
 
Back
Top