How to aggregate the following data-structure

  • Thread starter Thread starter Sebastian
  • Start date Start date
S

Sebastian

Hi !

I am stumped with the following problem: I have a table
with the following structure:

Field1 Field2
1000 5
1000 15
1003 20
1003 1

etc. No primary key, just raw-data... Field1 contains an
article-number and field2 a count. is there an easy way to
create a query or new table wich contains just the number
and the total count for that item ?
eg.
1000 17
1003 21


Thanks

Sebastian
 
Assuming you meant that the total for Field1 = 1000 in your example should
be 20 and not 17, you might try a query whose SQL looks something like this:

SELECT
[Your Table].[Field1],
Sum([Your Table].[Field2]) AS [Total]
FROM
[Your Table]
GROUP BY
[Your Table].[Field1]
 
-----Original Message-----
Assuming you meant that the total for Field1 = 1000 in your example should
be 20 and not 17, you might try a query whose SQL looks something like this:

SELECT
[Your Table].[Field1],
Sum([Your Table].[Field2]) AS [Total]
FROM
[Your Table]
GROUP BY
[Your Table].[Field1]
 
have a table
with the following structure:
....

etc. No primary key,

Just to quibble: if there is no primary key then it's not a table.

B Wishes


Tim F
 
Back
Top