A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

% of Orders that fall into discreet ranges



 
 
Thread Tools Display Modes
  #1  
Old July 25th, 2008, 06:59 PM posted to microsoft.public.access.queries
JJP
external usenet poster
 
Posts: 20
Default % of Orders that fall into discreet ranges

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.

  #2  
Old July 25th, 2008, 07:20 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default % of Orders that fall into discreet ranges

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" wrote:

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.

  #3  
Old July 26th, 2008, 07:49 AM posted to microsoft.public.access.queries
JJP
external usenet poster
 
Posts: 20
Default % of Orders that fall into discreet ranges

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

"KARL DEWEY" wrote:

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" wrote:

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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.