showing columns and a column's sum

  • Thread starter Thread starter aa
  • Start date Start date
A

aa

if I have a table containting InvoiceNumber, ItemCode, ItemPrice
and I whish to view all items belonging to a prticular invoce, I run
Select ItemCode, ItemPrice
FROM ...
WHERE InvoiceNumber="something"

How do I modify this query to shows also the total of this invoice, i.e. the sum of ItemPrice ?
 
This is almost always done in a report with group or report totals. However,
you could try:
Select ItemCode, ItemPrice
FROM ...
WHERE InvoiceNumber="something"
UNION
Select "All Items", Sum(ItemPrice)
FROM ...
WHERE InvoiceNumber="something"

--
Duane Hookom
MS Access MVP


if I have a table containting InvoiceNumber, ItemCode, ItemPrice
and I whish to view all items belonging to a prticular invoce, I run
Select ItemCode, ItemPrice
FROM ...
WHERE InvoiceNumber="something"

How do I modify this query to shows also the total of this invoice, i.e. the
sum of ItemPrice ?
 

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

Back
Top