Getting Post Between Rank X And Rank Y

Aug 11, 2005

Hi,

I've got a table with football players, each player has a name,
id and a value. The value gets updated everytime the player
has played a match.

I don't have a rank field, and lets assume it's not possible to
add it.

I'd like to get, not the "top" players but the players from, say
rank 10 to rank 20. What I do now, is I get all the players (ordered by their value) and then loop thru the resultset.

Code:strSQL = "SELECT * FROM player ORDER BY player.score DESC;"rsPowerbabe.Open strSQL, adoConFor i = from_rank To to_rank Response.Write (rsFootballPlayers("name")) Response.Write (",") rsFootballPlayers.MoveNextNext

I think it would be more effective, if I could let access do the
hard work..

Any ideas?

Thanks in advance,

Rost

View Replies


ADVERTISEMENT

Rank Query Gap???

Oct 17, 2005

I have set up two queries to generate a rank order based volume generated. The query does what I want for the most part in that if two parties have the same volume, they have a common rank (this is what I want to have happen). The problem comes that at various points throughout the data set, some of the rank sequence will be skipped...example, rank 265 to 267 (skips 266) and rank 786 to 790 (skips 787, 788, 789).

How can I close the gaps?

Here are the two queries...

Query 1
SELECT VolRnkALL.group_code, Sum(VolRnkALL.avg_group_volume) AS SumOfAvg_Group_Volume
FROM VolRnkALL
GROUP BY VolRnkALL.group_code
ORDER BY Sum(VolRnkALL.avg_group_volume) DESC;

Query 2
SELECT qry_SetRankSTEP1.group_code, qry_SetRankSTEP1.SumOfAvg_Group_Volume AS Expr1, (SELECT Count(*) FROM qry_SetRankSTEP1 t1

WHERE
t1.SumOFAvg_group_volume >= qry_SetRankSTEP1.SumOFAvg_group_volume) AS Rank
FROM qry_SetRankSTEP1;

Thanks for your help

View 2 Replies View Related

Help With SQL To Rank Records

Oct 30, 2007

Hi,

I have a query which brings back the following columns:

YEAR; PERIOD; STORE; PRODUCT; GP.

The table it is referring to is called 05_FULL_TABLE and I have changed the Alias for this table within my query to 05_FULL_TABLE1.

I'm trying to add a field which will rank the products by GP (Highest GP=1), within each group i.e. the rank starts from 1 again every time you hit a new year, period, or Store.

I've taken a suggested method from Microsft Support: http://support.microsoft.com/kb/208946
Seniority: (Select Count(*) from Employees Where [HireDate] < _
[Emp1].[HireDate];)

and changed it to: RANK: (Select Count(*) from 05_FULL_TABLE Where ([SumOfGP] < [05_FULL_TABLE1].[SumOfGP] AND [STORE_FKEY] = [05_FULL_TABLE1].[STORE_FKEY] AND [YEAR] = [05_FULL_TABLE1].[YEAR] AND [PERIOD] = [05_FULL_TABLE1].[PERIOD]) +1)

It is adding a rank, but it is not starting the rank again at any of the changes in store etc (which are all sorted Ascending in the query result), so I guess my "WHERE" clause isn't right. Can anyone suggest where I've gone wrong?

Many Thanks

Andrew

View 2 Replies View Related

How To Rank Data Result

Jul 7, 2005

I have a table which has got the following fields:
Name and
Points

I want to create a third fieldw with the name of rank which should give automatic results of rank that is the one with the maximum points should have '1' written in his rank column. Similarly, all rank fields should be filled accordingly.
I used the help, it said i should apply the syntax.
I do not know how and where to apply that syntax
Your help is appreciated
[HassaaN]

View 1 Replies View Related

Help With Rank Query- Everything Gets Ranked The Same!

Jun 26, 2006

Hi All,

I'm having a problem with my rank query......I have some unique integers that are all being ranked the same.

Sample values in dates table, stored as numbers:

[date]
200544
200545
200546
200547
etc

I'm using the rank example from the MS website, as follows:

rank: (Select Count(*) from dates Where [date] < [dates].[date];)

I get a rank of zero for every value!

I've tried running this in the MS sample DB and it works fine.

Any insight appreciated!

Cheers,

N

View 1 Replies View Related

Define A Rank In Query

Dec 27, 2007

Dear all
i have a trouble to define a rank in query, i have a table named SALES
like below

region PRoduct qty
jabar A 10
Jabar B 20
Jabar C 30

Jateng A 50
Jateng B 40
Jateng C 35

i want to give a result in my query like below

region PRoduct qty Rank
jabar C 30 1
Jabar B 20 2
Jabar A 10 3

Jateng A 50 1
Jateng B 40 2
Jateng C 35 3


anyone can help me???thanks

regards

martell

View 1 Replies View Related

Rank Column In Query

Feb 20, 2008

Hi,

I am trying to add a column into a query to rank items in that query.

For example, I want this table:

Name Score
Lee 10
Simon 8
Steve 8
Mike 6

to read:

Name Score Rank
Lee 10 1
Simon 8 2
Steve 8 2
Mike 6 4

I have read the Microsoft help but everytime I try and change the alias name of the query within a query, Access automatically says it is closing??

Any ideas

Many thanks in advance

Lee

View 1 Replies View Related

Queries :: How To Rank By Categories

Aug 22, 2013

I need to get the 4th column of this table:

PeriodPlayer AmountRank

201301ana 150 1
201301luis 100 2
201301raul 50 3

201302ana 125 1
201302raul 100 2

But I do not know how.

I have get up to there:

Rank: (Select Count(*) From [Tabla] Where [Amount]>[Player1].[Amount]+1

View 1 Replies View Related

How To Use Rank Function In Ms Access

Dec 5, 2011

I trying to use Oracle Rank function in MS-ACCESS. How do I do that? Here is table and output I am looking for

Table: TaxType

Tax_no Tax_Name Start_Date Tax_Percent
----------------------------------------------------------------------
1 VAT 1/1/2008 2.3
2 VAT 1/1/2009 2.5
3 VAT 1/1/2010 2.6
4 REW 2/1/2008 1.6
5 REW 2/3/2009 4.3
6 OTH 3/1/2008 5.6
7 TGH 11/1/2009 6.7

If I pass a Date 10/1/2009 I need below result(ie maxdate of each Tax_Name with percentage)


1 VAT 1/1/2009 2.5
5 REW 2/3/2009 4.3
6 OTH 3/1/2008 5.6

I used to do this in oracle using RANK function. I do not know how to do this in MSACCESS

SELECT Tax_ID, Tax_Name, Start_Date, Tax_Percent,
RANK() OVER (PARTITION BY Tax_Name ORDER BY Start_Date desc) as Date_rank
FROM TaxType where start_date<=to_date(10/01/2010, 'mm/dd/yyyy')

View 3 Replies View Related

Average Rank Query

Sep 22, 2015

Right now, I have an output that looks like this:

Code:
AvgCost CompanyID Policy#
25 22 12
28 23 12
35 24 12
21 25 12
20 22 20
15 24 20
13 23 21
43 24 21
Etc.

I want to know if it is possible to get an output that adds a ranks the CompanyIds by average cost per each policy #.how companyID24 ranks, and I have the query set up where it only outputs Policy#'s that company 24 is ranked in (has sold product in).

Code:
AvgCost CompanyID Policy# Rank
25 22 12 2
28 23 12 3
35 24 12 4
21 25 12 1

[code]....

View 11 Replies View Related

General :: Remove Rows With One Duplicate Field In A Rank?

Feb 6, 2013

I have a competition ranking contestants. A contestant can compete multiple times, each time with a unique registration number.

I am trying to sort by score to rank the contestants, however the contestants can only receive one rank - their highest score (not a sum of their scores, only one score). ? ?

Example:
Registration Name Score
2345 Sally 247
3456 George 230
4672 Sally 255

What I want to see:
4672 Sally 255
3456 George 230

View 5 Replies View Related

Queries :: Rank Fields Of A Query Based On Another Field

Jan 18, 2015

I have the query below that return a table like:

PLOTNR; period,Value, ID, Basal_area/ha, Basal_area/ha, perc_BA_sp

What I want to is to add another field that rank the perc_BA_sp by PLOTNR descending (thus highest perc_BA_sp values rank one etc.)

Code:
SELECT[Q:INV1-Basal_area_plot-spp].PLOTNR,
1 AS period,
[Q:INV1-Basal_area_plot-spp].Value,
[Q:INV1-Basal_area_plot-spp].ID,
[Q:INV1-Basal_area_plot-spp].[Basal_area/ha],
[Q:INV1-Basal_area_plot].[Basal_area/ha],
([Q:INV1-Basal_area_plot-spp]![Basal_area/ha]/[Q:INV1-Basal_area_plot]![Basal_area/ha])*100 AS perc_BA_spFROM[Q:INV1-Basal_area_plot-spp]

[code]....

View 1 Replies View Related

Queries :: School Database - Student Rank In Individual Subject

Sep 25, 2013

I am developing database for my school. I am done with everything except the examination aspect where i need to indicate students position in every subject beside their overall position according to the sum of all the subject scores. How to indicate student position in subjects.

View 2 Replies View Related

Where Should I Post?

May 6, 2005

I have a very involved question regarding the export of data from and Access front end, SQL back end into multiple Excel Worksheets.

Where is the best place to post this in order to get maximum exposure to the great minds that cruise this board.

Regards

View 2 Replies View Related

Not Sure Where To Post This

May 17, 2005

I have a form that has several multiple choice question and i have also designed a table and update queries for the DB so far i can enter the values and then have them changed from the original to the values requested by my bos however i also need to find a way to make a report that will allow me to shot the percentage of people that chose each individual answer with anywhere from 2 to 10 possible choices on each question i see no logical way to do this....... help!

View 1 Replies View Related

My First Post

May 24, 2005

Hello every one
I am new here and this is my first post
I am trying to make overtime record for my company
I use the following feilds

field name .................... format
Start_Time ................... short time
End_Time ..................... short time
Total_Over_Time ........... short time

now when i use
Total_Over_Time = [End_Time]-[Start_Time]
I got correct answer

but

while i am trying to make monthly report
if Total_Over_Time is greater then 24 hours it shows me 1

means for 25 hours is shows 1

Please help me to overcome this problem

Thanks


Pehalwan

View 5 Replies View Related

Don't Know Where To Post This

Jul 8, 2006

I am developing an Access (2000) database to provide reporting data gathered from SAP and make it easily accessable for 12 analysts. The data set is HUGE, 5 months nearly a gig and will need at least 2 years worth, so I don't see any option other than using SQL as a back end. I have experiance using SQL server as the back end but have never had to develop my own server.

I do not have access to an existing server but do have permission to purchase SQL software, this is where I need the help. If anyone has suggestions, advice, links or other information I would be greatly appreciative.

Thanks in advance for your help.

“where I added information”

A lot of you have been reading this but no help.:eek: Did I use a poor title? I have used SQL as a back end but really need to know how to produce one out of thin air.

I ordered SQL 2005 off my company's IT store but when reading further it needs a special operating system, I think. Is this true? What do I need to have in order to provide a very large data set to a bunch of barely computer literate analysts?

These people are excited when they realize that vlookup can do more than one thing!! The concept of a union query would blow them away. I am frustrated with the competency of my co-workers but need to give them something that is idiot proof without letting them know that this is the object.

Currently they are having an SAP download sent to a specified share drive and running an Excel “macro”, moves a couple of columns an such, that puts it into a format that is semi-usable. This is totally inefficient for their needs but they don’t know it as yet.

What I am asking is how to take a fairly robust pc and make it a SQL server that will service a dozen or so people. What kind of operating system is needed and what sort of admin rights will be necessary to allow access to the desktop so they can get their data?

The IT help desk is very scary, not really understanding the requests presented. I haven’t been with the company very long but what I have garnered disturbs me I don’t believe the IT people have a clue.

I’ve been an Access developer for about 4 years now and know this is not an insurmountable obstacle. I am confident that SQL is the solution but haven’t ever had to create it from scratch before. Please, links or other suggestions are MOST appreciated.

View 1 Replies View Related

Dunno Where To Post This....

Sep 4, 2007

Preface: I don't know where to post this since I'm using a VBA executed SQL command or if this is a table issue.

I'm trying to import a .csv file into a "master" table of several .csv files. I've figured out how to link them and import them even though they have different field names, but the problem I'm running into is with serial numbers.

Some serial numbers are entirely numbers, while others are alphanumeric. When the field is set to numbers all of the parts (a different field) show up, but not all of the serial numbers are imported. When the field is set to text some of the parts are dropped, along with their associated serial numbers and then some of the serial numbers show up as scientific notation.

Any ideas on how to solve this problem?

View 2 Replies View Related

Does Anyone Know How To Post A Db On This Forum

Mar 17, 2005

could anyone please tell me how to post a database on this forum ive tried attachingit but it says file not suitable

View 4 Replies View Related

Database Example. Please Post

Nov 10, 2005

i need dbase example from all of u..especially example for newbie like me...i'm looking for example that update subform using combobox...

View 5 Replies View Related

Post Code Search

Aug 16, 2005

does anyone know if it is possible to add a post code checker/search to access, if so do you know of one which works. I want to be able to bring up an addess by post code/house number in the UK

View 2 Replies View Related

Validating A Post Code

Nov 29, 2006

HiBeen trying To Find A Way Of Validating A Postcode.But Getting No Where Being They Can Be Like CT1 1QX, CT11 2DT, CT11 12DT Act.Best I've done is to make sure there's a space and it starts and ends with a Letter.Any Help Advice Would be much AppreciatedMick

View 2 Replies View Related

Difference Between Post And Thread

Mar 15, 2007

Hi guys am not sure if i got dis in d correct forum (forgive me if not)

Just wanted 2 know what's d diff btwn a thread & a post (if d's any)

Noks

View 6 Replies View Related

Post-code On Form

Jan 23, 2008

Hallo,

I have a post code field on my form. What I want to do is, if a user enters a wrong code ... i,.e., not Post code format it alerts the user of post-code not in use. Please if there is any example of a database of this functionality usage or a way of doing it will be much appreciated.

I live in UK and the post codes down here are like E12 5AH ....

Many thanks

View 1 Replies View Related

Follow-Up To Previous Post...

Nov 15, 2004

Greetings,

I am just posting a follow-up on my previous post on designing functional forms. Telling by the lack of replies, my original question may have been long winded and tedious. Let me try to narrow my question and make it more concise.

In two tables connected by a one-one field name ProfileID, how can I set a new field in the second table (call it StepNo or procedureNo) so that it increments step numbers for each unique ProfileID record? Thus for each new Profile record created in the first table, a new form will allow the entry of X numbers of steps into the second table and automatically link the two records?

I hope that clarifies my problem. Thanks in advance.

View 3 Replies View Related

Post Code Validation

Apr 7, 2006

I have searched the forum for posts on the subject of UK postal code validation and found the reg expression that seems to be recommended for this.

I tried the expression but it will not accept this postal code? TS183AM

Like "(?:(?:A[BL]|B[ABDHLNRST]?|" & "C[ABFHMORTVW]|D[ADEGHLNTY]|E[CHNX]?|F[KY]|G[LUY]?|" & "H[ADGPRSUX]|I[GMPV]|JE|K[ATWY]|L[ADELNSU]?|M[EKL]?|" & "N[EGNPRW]?|O[LX]|P[AEHLOR]|R[GHM]|S[AEGKLMNOPRSTWY]?|" & "T[ADFNQRSW]|UB|W[ACDFNRSV]?|YO|ZE)" & "d(?:d|[A-Z])? d[A-Z]{2})"

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved