Complex Counting Query

S

SilentThunder

Hey folks,
I've got a query here that's killin' me, and I was hoping someone
could offer some suggestions. I have two tables...

Table A
Field1: Date (no null values)
Field2: Consult Number (Alphnumeric - no nulls)
Field3: Product (Alphabetic - no nulls)
Field4: Working Type (Alphabetic - no nulls)

Table B
Field1: Date (no null values)
Field2: Consult Number (Alphnumeric - no nulls)
Field3: Product (Alphabetic - no nulls)

The relationship between the two tables is that they both have the
same group of products in them

Table A has several different Products, each of which has several
different "Working Types", and each individual record has it's own
Consult Number, so a record looks like this:
Date Consult Number Product Working Type
5/1/7 a123456789 Hammer Pneumatic
I have to filter through Table A and only use 5 specific "Working
Type's"

Table B Is identical to Table A except there are no "Working Types",
so I use all the records in the table


What I need to do is create a Query that that will list all the
different Products, and a count of consult numbers for each Working
Type from Table A, and a count of Consult numbers from Table B, that
will look like this:::

(Assuming WT = "Working Type" and TB = "Table B")

Product WT1 WT2 WT3 WT4 WT5 TB
Hammer 5 2 8 3 2 1
Nail 8 3 7 9
1 6
Screws 7 2 0 3 4 8




Any Suggestions?
 
Top