Combining items in report

P

pilgrim

I have a table with fields [quantity] [Part#] Description]
In this table records repeat themselves with same part number and
description but the qty changes. I would like a report that combines the
parts numbers that are same and totals the qty. Is this possible?
 
J

Jeff Boyce

If you want the "sum" of like part#s, you can use a query to do this (the
"Totals" queries).

If you want to add a total to your detail report, you can do this as well.
In fact, the New Report Wizard will even help you do this the first time.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
M

Marshall Barton

pilgrim said:
I have a table with fields [quantity] [Part#] Description]
In this table records repeat themselves with same part number and
description but the qty changes. I would like a report that combines the
parts numbers that are same and totals the qty. Is this possible?


Sure it's possible. Generally, you should create a Totals
type (GROUP BY) query that does the calculations. Lacking
any other information, the qury's SQL would be along these
lines:
SELECT T.[Part#], T.[Description],
Sum(T.Quantity) As TotalQty
FROM table As T
GROUP BY T.[Part#], T.[Description]

Then use the query as the report's record source and the
rest should be straightforward.

A different (not as flexible and less efficient) way is to
base the report on the table and use Sorting and Grouping to
create a group on the [Part#] field. The group header or
footer section would have text boxes bound to the [Part#]
and [Description] fields and a text box with the expression
=Sum(Quantity). Make the detail section invisible.
 
P

pilgrim

Thanks, I used the grouping on the report. It has the added benifit if the
description changes but part # stays same it does not combine. This helps if
I change desciption on the fly or add comments in that field. Thanks Again, Ed

Marshall Barton said:
pilgrim said:
I have a table with fields [quantity] [Part#] Description]
In this table records repeat themselves with same part number and
description but the qty changes. I would like a report that combines the
parts numbers that are same and totals the qty. Is this possible?


Sure it's possible. Generally, you should create a Totals
type (GROUP BY) query that does the calculations. Lacking
any other information, the qury's SQL would be along these
lines:
SELECT T.[Part#], T.[Description],
Sum(T.Quantity) As TotalQty
FROM table As T
GROUP BY T.[Part#], T.[Description]

Then use the query as the report's record source and the
rest should be straightforward.

A different (not as flexible and less efficient) way is to
base the report on the table and use Sorting and Grouping to
create a group on the [Part#] field. The group header or
footer section would have text boxes bound to the [Part#]
and [Description] fields and a text box with the expression
=Sum(Quantity). Make the detail section invisible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top