% of Orders that fall into discreet ranges

  • Thread starter Thread starter JJP
  • Start date Start date
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.
 
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, 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.
 
Back
Top