Cross Tab Query

  • Thread starter gm6243 via AccessMonster.com
  • Start date
G

gm6243 via AccessMonster.com

Hi,

I have a crosstab query which generates report in the following manner
Group
Category1
prodID, ProdName, Mth1, mth2, mth3 .......
1 ABCInk 50 20 30 .......
2 cdecable 30 79 98 ......
tot cat1 80 99 128 ........
Category2
.....................
tot cat 2

Total group ......150 449 689 ...

I want to add a row below the total group which would be a percentage or tot
Cat1 to the total group

In the above example it should be 80/150 = 53.33%


I am not able to get how to calculate the Cat1 % to the total cost. Can
someone please advise as to how to go about presenting this on a report. I am
able to present the data without the % row.

Please help.
my crosstab query is below:


PARAMETERS [Forms]![Monthly Reports]![EndDate] DateTime;
TRANSFORM Sum(Labsum.SumOfCharges) AS Charges
SELECT TransType.TransDescription, TransType.Group, TransType.Category,
Labsum.Transtype
FROM TransType INNER JOIN Labsum ON TransType.TransType = Labsum.Transtype
GROUP BY TransType.TransDescription, TransType.Group, TransType.Category,
Labsum.Transtype
PIVOT "Mth" & DateDiff("m",[ReportDate]-1,[Forms]![Monthly Reports]![EndDate])
In ("Mth0","Mth1","Mth2","Mth3","Mth4","Mth5","Mth6","Mth7","Mth8","Mth9",
"Mth10","Mth11","Mth12");

Thanks
Gimen
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do this in the report - it's easier.

How to:

This assumes the name of your group total Text Box is "txtGroupTotal."

Put a text box in the Group footer with the Control Source like this:

=txtCatTotal/txtGroupTotal

Set the control's Format property to Percent.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBScLN1YechKqOuFEgEQL0SgCgwA8eCMEnUNuTUvlLnD6Yz1qBae4AoPOe
iSAyqpNyHiUs3wDAw0xWSCk6
=0FGK
-----END PGP SIGNATURE-----
 

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

Similar Threads


Top