473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Where is Rank Function in Access 2007?

1
I am trying to derive rank values in a query, just as one would with the Rank function in Excel. I use MS Access 2007 and want to build a query that will do it. I know how to build queries to give me only the top N but I don't want to have to build multiple queries for this request.
Sep 17 '12 #1
4 11311
twinnyfo
3,653 Expert Mod 2GB
SLK836,

As far as I know there is no Rank function (an incredible life saver in Excel!) in MS Access. However, what I have done is create a query. Then based on the results of that query, I create another query based on the same fields, and count how many records are above the current recordds based on the criteria of the current record.

For example, if you had a list of employees with their current salary, you would use the current record and count how many records in the current dataset have salaries greater than the current one. Then you add 1 (i.e. the highest salary will have zero records greater). This also accounts for ties, so that if record 3 and 4 are tied, they both receive 3's, but the next record is a 5.

Not sure if this makes sense, but without your data, and without writing your queries for you, this will get you in the right direction. I'll be glad to work through additioinal details....
Sep 17 '12 #2
Rabbit
12,516 Expert Mod 8TB
Subqueries are one way of doing it. They're slower but easier to understand.

You can also accomplish a similar result by joining the table to itself. It's faster but slightly more difficult to set up.
Sep 17 '12 #4
zmbd
5,501 Expert Mod 4TB
SLK836:

Rabbit's suggestion of the self join would more than likely be the best solution.

Because you didn't post any data, I did not suggest the self join due to the potential difficulties in setting up the query and instead offered the other two methods.

I say, have a go at the self join and let us know how you fair... in either case (good or bad) please post your SQL so that we can either help or tune it!

Best of Luck
Sep 17 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Elden Carnahan | last post by:
I am trying to derive rank values in a query, just as one would with the Rank function in Excel. Can't see how to do this elementary task. Can anyone advise?
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
0
by: Cindy Huyser | last post by:
I have an Access 2000 database behind a threaded Java application that that can have have concurrent access to the same table (but not the same record). The database is set up for shared access...
1
by: rickcross | last post by:
I am trying to use the Access 2007 runtime. I have a program that is fully working in 2007 but when I install the runtime version with same Operating system and Access 2003 installed I have...
2
nico5038
by: nico5038 | last post by:
Access 2007 Linkedtable manager refuses to relink tables having a field with the "Attachment" datatype. Problem: When placing a split database in another folder, the Linked table manager should...
8
by: mguy27 | last post by:
We have about 2 dozen security officers who patrol about 120 buildings. They find defective or unlocked doors and write a "Trouble Report" on the door. This card gets turned in, where I have designed...
7
by: Icarus | last post by:
I have a Access 2000 database that I am opening with Access 2007. When I open the datbase in Access 2000 or Access 2003, the database runs as expected. In Access 2007 my main form opens, a...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
1
newnewbie
by: newnewbie | last post by:
Hi, Short version: trying to export more than 65K of data from Access 2007 into Excel 2007 (important) through VBA. Access gives me 65K row limitation error, though I thought that was no longer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.