counting record

  • Thread starter Thread starter PF
  • Start date Start date
P

PF

Hi all,

i have 2 tables wich have a product number and associate data (not show)

table a table b

product product
x1 x1
x1 x1
x1 x2
x2 X3
x2 X4

I want to create a third table with a product number and a count.
All products must be listed the maximum number of time they appear in a or
b.
An other field is the count of the number of time that product appear

table c
x1,1
x1,2
x1,3
x2,1
x2,2
x3,1
x4,1

Regards
Pierre
 
Rather than creating a table, how about a Totals query? If you GroupBy
ProductNumber and use Count, you'll end up with a "dynamic" count. If you
build a table, you'll have to refresh it every time something changes in the
underlying product table.
 
thanks for the reply,

I need the table. Note that the underlying table dont change.
if for a product x there is 3 recordss in tbl a and 6 records in tbl b.
if for a product y there is 2 record in tbl a and 1 in tbl b.
i need:

x,1
x,2
x,3
x,4
x,5
x,6
y,1
y,2


I need that because i want as many lines as the maximum of a product in any
of the two table

Then i am going to link that table with tbl a and tbl b and list records.
the final thing is

x,data from a, data from b
x,data from a, data from b
x,data from a, data from b
x,empty since x appear only 3 times in tbla, data from b
x,empty since x appear only 3 times in tbla, data from b
x,empty since x appear only 3 times in tbla, data from b
y,data from a, data from b
y,data from a, empty since y appear only one time in tbl b

Kind of spreadsheet stuff

I try with an union but it merge the product field

regards
 
Back
Top