A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to compute partial sums?



 
 
Thread Tools Display Modes
  #1  
Old December 14th, 2007, 06:01 AM posted to microsoft.public.access.tablesdbdesign
Siegfried Heintze
external usenet poster
 
Posts: 9
Default How to compute partial sums?

I have a bunch of restaurant receipts in a database and I want to sum all
the items of each receipt. Each row of the result set would be a receipt
number and a sum of the price of the line items.

What might a query like this look like?

Is is possible to write a query that would list all the line items grouped
by receipt numbers with sub totals for each receipt?

Thanks,
Siegfried


  #2  
Old December 14th, 2007, 03:07 PM posted to microsoft.public.access.tablesdbdesign
Roger Carlson
external usenet poster
 
Posts: 824
Default How to compute partial sums?

This would be better done in a report.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"Siegfried Heintze" wrote in message
...
I have a bunch of restaurant receipts in a database and I want to sum all
the items of each receipt. Each row of the result set would be a receipt
number and a sum of the price of the line items.

What might a query like this look like?

Is is possible to write a query that would list all the line items grouped
by receipt numbers with sub totals for each receipt?

Thanks,
Siegfried



  #3  
Old December 14th, 2007, 06:53 PM posted to microsoft.public.access.tablesdbdesign
Siegfried Heintze
external usenet poster
 
Posts: 9
Default How to compute partial sums?


"Roger Carlson" wrote in message
...
This would be better done in a report.

I assume that means it cannot be done in a single SQL statement but could be
done in some custom code or (better yet) crystal reports? Do you have any
favorite low $ cost alterantives (open source maybe) to purchasing crystal
reports? I suspect I would get quite a few hits if I google searched.

Thanks,
Siegfried


  #4  
Old December 14th, 2007, 09:50 PM posted to microsoft.public.access.tablesdbdesign
Pat Hartman
external usenet poster
 
Posts: 392
Default How to compute partial sums?

I don't believe that Roger suggested Crystal. Access comes with a fabulous
report writer. It is simple to use and very powerful.

You are attempting to create a "report" so use the correct tool and you
won't have any issues.


"Siegfried Heintze" wrote in message
...
I have a bunch of restaurant receipts in a database and I want to sum all
the items of each receipt. Each row of the result set would be a receipt
number and a sum of the price of the line items.

What might a query like this look like?

Is is possible to write a query that would list all the line items grouped
by receipt numbers with sub totals for each receipt?

Thanks,
Siegfried



  #5  
Old December 17th, 2007, 09:40 AM posted to microsoft.public.access.tablesdbdesign
Jamie Collins
external usenet poster
 
Posts: 1,705
Default How to compute partial sums?

On Dec 14, 5:01 am, "Siegfried Heintze" wrote:
I have a bunch of restaurant receipts in a database and I want to sum all
the items of each receipt. Each row of the result set would be a receipt
number and a sum of the price of the line items.

What might a query like this look like?


If the all query to show all the items of each receipt looks like
this:

SELECT receipt_number, receipt_item_description, receipt_item_price
FROM YourTable;

then the query to sum all the items of each receipt might look like
this:

SELECT receipt_number, SUM(receipt_item_price) AS
receipt_items_price_total
FROM YourTable
GROUP BY receipt_number;

Jamie.

--

  #6  
Old December 18th, 2007, 08:18 PM posted to microsoft.public.access.tablesdbdesign
Dale Fye
external usenet poster
 
Posts: 2,651
Default How to compute partial sums?

Personally, I think Access has the best reporting tool around. There has not
been much I have not been able to figure out how to do with assistance from
the various Access newsgroups.

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"Siegfried Heintze" wrote:


"Roger Carlson" wrote in message
...
This would be better done in a report.

I assume that means it cannot be done in a single SQL statement but could be
done in some custom code or (better yet) crystal reports? Do you have any
favorite low $ cost alterantives (open source maybe) to purchasing crystal
reports? I suspect I would get quite a few hits if I google searched.

Thanks,
Siegfried



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.