Calculate Percentages

  • Thread starter Thread starter Fiona
  • Start date Start date
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?
 
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]
 
Back
Top