% of Orders that fall into discreet ranges

J

JJP

I would like to know what percentage of orders in my database fall into
discreet price ranges. i.e. 0 to 10K, 10-25K, etc.
I have been able to set up formulas for these ranges, but when I try to use
a count function I wind up getting the same count for everthing when what I
really want is

0-10K: X %
10-25K: X%
25-75K: X%

ect.

Any ideas for doing this at the query level would be appreciated.
 
K

KARL DEWEY

You can use this query changing table and field names to yours.

SELECT Partition([x],0,22,3) AS Range, Count([x])/DCount("x","Change
Requests") AS [Percent in range]
FROM [Change Requests]
GROUP BY Partition([x],0,22,3);

The partition function -- Partition([YourFieldName], StartNumber,
EndNumber, Increment)
 
J

JJP

Karl, thank you, it did the trick!
John Pierce

KARL DEWEY said:
You can use this query changing table and field names to yours.

SELECT Partition([x],0,22,3) AS Range, Count([x])/DCount("x","Change
Requests") AS [Percent in range]
FROM [Change Requests]
GROUP BY Partition([x],0,22,3);

The partition function -- Partition([YourFieldName], StartNumber,
EndNumber, Increment)

--
KARL DEWEY
Build a little - Test a little


JJP said:
I would like to know what percentage of orders in my database fall into
discreet price ranges. i.e. 0 to 10K, 10-25K, etc.
I have been able to set up formulas for these ranges, but when I try to use
a count function I wind up getting the same count for everthing when what I
really want is

0-10K: X %
10-25K: X%
25-75K: X%

ect.

Any ideas for doing this at the query level would be appreciated.
 

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