Calculate Percentages

F

Fiona

I have a database which contains information about sale
prices. For each entry there is a saledate, saletype and
saleprice. The Saleprice either has a 0 indicating that
the item is unsold or a price for example 10. For each
saledate i want to find the percentage of unsold items on
that date. For example if there were 45 items in total, 7
of which had a price of 0 and 38 had a price then the
percentage of sold lots would be 84.44% and unsold 15.5%.
Is there a way in which this can be calculated in access?
 
B

Brian Camire

You might try a query whose SQL looks something like this:

SELECT
[Your Table].[saledate],
Sum(IIf([Your Table].[saleprice]<>0,1,0)) / Count(*)
FROM
[Your Table]
GROUP BY
[Your Table].[saledate]
 

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

Top