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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

subtotal on a group in a report



 
 
Thread Tools Display Modes
  #1  
Old November 14th, 2005, 04:33 PM
cmk
external usenet poster
 
Posts: n/a
Default subtotal on a group in a report

I haven't been able to find a way to subtotal a group correctly in a report.

My report is using a query that has two tables joined. First table is a
Stock Type Table and the second table is a Transaction Table.

The first table has the original # of shares and the second table has the
number of shares sold on a specific date.

I have four headers in the report. The first header stock type is the one I
want a subtotal on. I want to be able to subtotal the original # of shares
purchased from the First Table and put it in the First Footer. I need to
make sure that if I have several transactions in table 2 it doesn't add the
original shares several times but just once.

Thanks
  #2  
Old November 14th, 2005, 08:03 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default subtotal on a group in a report

cmk wrote:

I haven't been able to find a way to subtotal a group correctly in a report.

My report is using a query that has two tables joined. First table is a
Stock Type Table and the second table is a Transaction Table.

The first table has the original # of shares and the second table has the
number of shares sold on a specific date.

I have four headers in the report. The first header stock type is the one I
want a subtotal on. I want to be able to subtotal the original # of shares
purchased from the First Table and put it in the First Footer. I need to
make sure that if I have several transactions in table 2 it doesn't add the
original shares several times but just once.



I think the Type header/footer text box expression would be:
=originalshares - Sum(transactionshares)

--
Marsh
MVP [MS Access]
  #3  
Old November 14th, 2005, 08:36 PM
cmk
external usenet poster
 
Posts: n/a
Default subtotal on a group in a report

when I put in the formula below it returns a blank field. Any ideas what I
may be doing wrong

thanks
"cmk" wrote:

I haven't been able to find a way to subtotal a group correctly in a report.

My report is using a query that has two tables joined. First table is a
Stock Type Table and the second table is a Transaction Table.

The first table has the original # of shares and the second table has the
number of shares sold on a specific date.

I have four headers in the report. The first header stock type is the one I
want a subtotal on. I want to be able to subtotal the original # of shares
purchased from the First Table and put it in the First Footer. I need to
make sure that if I have several transactions in table 2 it doesn't add the
original shares several times but just once.

Thanks

  #4  
Old November 14th, 2005, 09:06 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default subtotal on a group in a report

cmk wrote:
when I put in the formula below it returns a blank field. Any ideas what I
may be doing wrong


"cmk" wrote:
I haven't been able to find a way to subtotal a group correctly in a report.

My report is using a query that has two tables joined. First table is a
Stock Type Table and the second table is a Transaction Table.

The first table has the original # of shares and the second table has the
number of shares sold on a specific date.

I have four headers in the report. The first header stock type is the one I
want a subtotal on. I want to be able to subtotal the original # of shares
purchased from the First Table and put it in the First Footer. I need to
make sure that if I have several transactions in table 2 it doesn't add the
original shares several times but just once.



Assuming you replaced my placeholder names with your own
**field** names (not control names), what expression did you
actually use?

Where did you put it?

Could you also provide some demonstative sample data from
the query along with the names of each field.

--
Marsh
MVP [MS Access]
  #5  
Old November 14th, 2005, 09:32 PM
cmk
external usenet poster
 
Posts: n/a
Default subtotal on a group in a report

I placed the following in stock type footer (the first footer (there are 3
other footers)):

=[CERTIFICATE (TABLE).NumberOfShares]-Sum([TRANSACTION
(TABLE).NumberOfShares])

My end result I want to be the sum of certificate [CERTIFICATE
(TABLE).NumberOfShares] by stock type

StockType Original Purchase Trans Amt Cert #
Common Stock 100 -5 bbb
Common Stock 100 -2 bbb
Common Stock 300 -50 ddd
subtotal 400
Preferred Stock 200 -50 fff
Preferred Stock 300 -25 ggg
Preferred Stock 200 -15 fff
subtotal 500

I am running the report off of 2 tables a detail transaction table and a
certificate table. In the above sample I am looking for the subtotal amount.


Let me know if there is something else you need -- thanks for your help

"Marshall Barton" wrote:

cmk wrote:
when I put in the formula below it returns a blank field. Any ideas what I
may be doing wrong


"cmk" wrote:
I haven't been able to find a way to subtotal a group correctly in a report.

My report is using a query that has two tables joined. First table is a
Stock Type Table and the second table is a Transaction Table.

The first table has the original # of shares and the second table has the
number of shares sold on a specific date.

I have four headers in the report. The first header stock type is the one I
want a subtotal on. I want to be able to subtotal the original # of shares
purchased from the First Table and put it in the First Footer. I need to
make sure that if I have several transactions in table 2 it doesn't add the
original shares several times but just once.



Assuming you replaced my placeholder names with your own
**field** names (not control names), what expression did you
actually use?

Where did you put it?

Could you also provide some demonstative sample data from
the query along with the names of each field.

--
Marsh
MVP [MS Access]

  #6  
Old November 14th, 2005, 11:28 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default subtotal on a group in a report

OK, that's very helpful information.

The syntax looks very suspicious. It looks like
CERTIFICATE (TABLE) and TRANSACTION (TABLE)
are the names of the tables in the query and that both
tables have a field named NumberOfShares. If so, the
references should be:

=[CERTIFICATE (TABLE)].NumberOfShares - Sum([TRANSACTION
(TABLE)].NumberOfShares)

But, I don't see how you get the subtotals in your sample so
the expression may not be right.
--
Marsh
MVP [MS Access]


cmk wrote:
I placed the following in stock type footer (the first footer (there are 3
other footers)):

=[CERTIFICATE (TABLE).NumberOfShares]-Sum([TRANSACTION
(TABLE).NumberOfShares])

My end result I want to be the sum of certificate [CERTIFICATE
(TABLE).NumberOfShares] by stock type

StockType Original Purchase Trans Amt Cert #
Common Stock 100 -5 bbb
Common Stock 100 -2 bbb
Common Stock 300 -50 ddd
subtotal 400
Preferred Stock 200 -50 fff
Preferred Stock 300 -25 ggg
Preferred Stock 200 -15 fff
subtotal 500

I am running the report off of 2 tables a detail transaction table and a
certificate table. In the above sample I am looking for the subtotal amount.


cmk wrote:
when I put in the formula below it returns a blank field. Any ideas what I
may be doing wrong


"cmk" wrote:
I haven't been able to find a way to subtotal a group correctly in a report.

My report is using a query that has two tables joined. First table is a
Stock Type Table and the second table is a Transaction Table.

The first table has the original # of shares and the second table has the
number of shares sold on a specific date.

I have four headers in the report. The first header stock type is the one I
want a subtotal on. I want to be able to subtotal the original # of shares
purchased from the First Table and put it in the First Footer. I need to
make sure that if I have several transactions in table 2 it doesn't add the
original shares several times but just once.



"Marshall Barton" wrote:
Assuming you replaced my placeholder names with your own
**field** names (not control names), what expression did you
actually use?

Where did you put it?

Could you also provide some demonstative sample data from
the query along with the names of each field.

  #7  
Old November 15th, 2005, 01:39 PM
cmk
external usenet poster
 
Posts: n/a
Default subtotal on a group in a report

My subtotals are the sum of the original purchase for each unique certificate
number. The original purchase is a field in the certificate table and in
this table it is only in the file once, but when I tie the certificate table
and transaction table together it may show up several times because each
certificate may have several transactions.

I think I might have found a solution by putting
=Sum([CERTIFICATE (TABLE).NumberOfShares])
in the first header (certificatetable.stocktype) then putting this field in
the first footer (certificatetable.stocktype)

It seems to be giving me a total for each stock type footer

thanks

"Marshall Barton" wrote:

OK, that's very helpful information.

The syntax looks very suspicious. It looks like
CERTIFICATE (TABLE) and TRANSACTION (TABLE)
are the names of the tables in the query and that both
tables have a field named NumberOfShares. If so, the
references should be:

=[CERTIFICATE (TABLE)].NumberOfShares - Sum([TRANSACTION
(TABLE)].NumberOfShares)

But, I don't see how you get the subtotals in your sample so
the expression may not be right.
--
Marsh
MVP [MS Access]


cmk wrote:
I placed the following in stock type footer (the first footer (there are 3
other footers)):

=[CERTIFICATE (TABLE).NumberOfShares]-Sum([TRANSACTION
(TABLE).NumberOfShares])

My end result I want to be the sum of certificate [CERTIFICATE
(TABLE).NumberOfShares] by stock type

StockType Original Purchase Trans Amt Cert #
Common Stock 100 -5 bbb
Common Stock 100 -2 bbb
Common Stock 300 -50 ddd
subtotal 400
Preferred Stock 200 -50 fff
Preferred Stock 300 -25 ggg
Preferred Stock 200 -15 fff
subtotal 500

I am running the report off of 2 tables a detail transaction table and a
certificate table. In the above sample I am looking for the subtotal amount.


cmk wrote:
when I put in the formula below it returns a blank field. Any ideas what I
may be doing wrong


"cmk" wrote:
I haven't been able to find a way to subtotal a group correctly in a report.

My report is using a query that has two tables joined. First table is a
Stock Type Table and the second table is a Transaction Table.

The first table has the original # of shares and the second table has the
number of shares sold on a specific date.

I have four headers in the report. The first header stock type is the one I
want a subtotal on. I want to be able to subtotal the original # of shares
purchased from the First Table and put it in the First Footer. I need to
make sure that if I have several transactions in table 2 it doesn't add the
original shares several times but just once.


"Marshall Barton" wrote:
Assuming you replaced my placeholder names with your own
**field** names (not control names), what expression did you
actually use?

Where did you put it?

Could you also provide some demonstative sample data from
the query along with the names of each field.


 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting records in a group for a report. Gil Grissom New Users 3 October 13th, 2005 05:52 PM
Has anyone seen this behaviour? What might it be? tw General Discussion 4 June 30th, 2005 03:23 PM
To Sharkbyte and all: Calculate a total values in group level Ally General Discussion 6 June 13th, 2005 08:16 PM
Total hours from Table into Report HeatherLou1974 General Discussion 3 March 7th, 2005 08:04 PM
Still Hoping for help with a Query problem Don Sealer Using Forms 15 November 13th, 2004 06:24 AM


All times are GMT +1. The time now is 09:24 PM.


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