Percentage problem

sislman01

Registered User.
Local time
Today, 14:27
Joined
Dec 2, 2005
Messages
10
Hi,

I have a database which contains the following column: -

TYPE OF COVER

This column has various covers in it i.e. 'COMP', 'TPFT', 'TP' etc

I would like to be able to run a query that shows the following columns: -

TYPE OF COVER , TOTAL NUMBER OF EACH COVER, PERCENTAGE TOTAL

I am new to SQL and would be grateful for some advice.

Regards
 
Hi -

I would do this in two stages -
1. Generate a query that first breaks the TYPE OF COVER into categories. You may be able to use a Crosstab query for this or you may need to use expressions with the IIF statement to generate counts for each one.

2. Generate a second query that utilizes the first. This query would use the aggregate functions to COUNT each occurrence and then generate a percentage.

hth,

-g
 

Users who are viewing this thread

Back
Top Bottom