Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include Percentages in Crosstab Query?

Status
Not open for further replies.

lorirobn

MIS
Mar 15, 2005
450
US
Hello,

I have a report based on a Crosstab query that displays counts.

Now I would like to have the same report display percentages instead, based on the total counts. For example, if the count is 50 and total count is 100, I would like to display 50% instead of 50.

For example:
Item Cond 1 Cond 2 Cond3 Cond4 Cond 5
ITEMABC 50% 25% 5% 20% 25%

Is there a way to do this using Crosstab Query? Or to put a text box in the report, where I can calculate percentages manually?

In case my question is misleading, here is my SQL that displays Counts:
Code:
TRANSFORM Count(tblGuestRoom.DeskOrTableCond) AS CountOfDeskOrTableCond
SELECT tblInventory.ItemLongDesc
FROM tblInventory INNER JOIN tblGuestRoom ON tblInventory.ItemNumber = tblGuestRoom.DeskOrTable
WHERE (((tblGuestRoom.DeskOrTable)<>" ") AND ((tblInventory.Item)="desk"))
GROUP BY tblInventory.ItemLongDesc
PIVOT "Cond" & tblGuestRoom.DeskOrTableCond In ("Cond1","Cond2","Cond3","Cond4","Cond5");

Thanks,
Lori
 
NEVER MIND - I have figured it out. Thanks anyway...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top