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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Ranking question



 
 
Thread Tools Display Modes
  #1  
Old February 11th, 2010, 03:49 PM posted to microsoft.public.access
Golfinray
external usenet poster
 
Posts: 1,597
Default Ranking question

I have a wealth index field where school district wealth indexes are used to
rank projects. For example, a school district has a wealth index of .44 (44%)
will get state funds before one with a wealth index of .58 (58%). What is
need is a WI rank. For example, Conway school district, anytime one of their
construction projects is entered in the database, they are always ranked 134
so there are 133 districts with higher ranking (funds priority). The when we
save that project in the table it also saves their ranking. Would I use a
combo to display query results on that or what? Thanks a bunch!!!!
--
Milton Purdy
ACCESS
State of Arkansas
  #2  
Old February 11th, 2010, 04:03 PM posted to microsoft.public.access
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Ranking question

Your tables should look like:
TblSchoolDistrict
SchoolDistrictID
SchoolDistrictName
WealthIndex
other school district fields

TblSchoolDistrictProject
SchoolDistrictProjectID
SchoolDistrictID
ProjectSubmissionDate
other project fields

If you wanted a list of all projects for all school districts in the order
of wealth index, create a query based on both tables and sort descending on
Wealth Index.

Steve





"golfinray" wrote in message
...
I have a wealth index field where school district wealth indexes are used
to
rank projects. For example, a school district has a wealth index of .44
(44%)
will get state funds before one with a wealth index of .58 (58%). What is
need is a WI rank. For example, Conway school district, anytime one of
their
construction projects is entered in the database, they are always ranked
134
so there are 133 districts with higher ranking (funds priority). The when
we
save that project in the table it also saves their ranking. Would I use a
combo to display query results on that or what? Thanks a bunch!!!!
--
Milton Purdy
ACCESS
State of Arkansas



  #4  
Old February 11th, 2010, 07:51 PM posted to microsoft.public.access
John Spencer
external usenet poster
 
Posts: 7,815
Default Ranking question

One way to get a rank
SELECT SchoolDistrict, WealthIndex,
, 1 + Dcount("*","SchoolDistricts","WealthIndex" & [WealthIndex]) as Rank
FROM SchoolDistricts

That will give you rankings From 1 to N and in cases of ties the tied schools
will all get the same rank and there will be a break in the ranks
....
..44 Someway 133
..44 Conway 133
..44 Sideway 133
..48 MyWay 136
..49 TheWay 137
....

If you needed to rank the wealth index with no breaks you can do that by
creating a list of unique wealth index values and then ranking the unique values.


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

golfinray wrote:
I have a wealth index field where school district wealth indexes are used to
rank projects. For example, a school district has a wealth index of .44 (44%)
will get state funds before one with a wealth index of .58 (58%). What is
need is a WI rank. For example, Conway school district, anytime one of their
construction projects is entered in the database, they are always ranked 134
so there are 133 districts with higher ranking (funds priority). The when we
save that project in the table it also saves their ranking. Would I use a
combo to display query results on that or what? Thanks a bunch!!!!

 




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 10:20 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.