Hey thank you it work flawlessly. I was trying to learn so I didn't used the fruit example. I create a new database and the field is just confusing trying to match the fruit example
thanks a lot guys
one last question relate to the problem how would I count the blank cell for example if one cell people haven't check out if it is a good or bad apple yet how would i incorporate in into the sql
The new revised code for your new question of including null status is as follows:-
Code:SELECT fruit, Count([fruit])/(Select Count([fruit]) from Table1) AS [% of Fruit], Sum(iif([Status]="Good",1,0))/Count([fruit]) AS [% of Good], Sum(iif([Status]="Bad",1,0))/Count([fruit]) AS [% of Bad], Sum(iif(isnull([Status]),1,0))/Count([fruit]) AS [% of NULL] FROM Table1 GROUP BY fruit;
Last edited by thhui; 05-21-2009 at 10:52 PM.
Thank you everyone I learned so much form you guy