473,385 Members | 1,693 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,385 software developers and data experts.

How to get the Total and getting the Ranking of the Totals using query in MSAccess?

Can someone help me get the total and getting the ranking of the totals following the data below using a query:

No - J1 - J2 - J3 - J4 - J5 - Total - Rank
01 - 10 - 10 - 15 - 20 - 30 - 85 - 2
02 - 10 - 15 - 15 - 10 - 10 - 60 - 4
03 - 15 - 20 - 20 - 15 - 25 - 95 - 1
04 - 20 - 10 - 10 - 10 - 10 - 60 - 4
05 - 15 - 15 - 20 - 10 - 20 - 80 - 3


Any help will be deeply appreciated. Thanks in advance!!!
Feb 7 '08 #1
4 1559
NeoPa
32,556 Expert Mod 16PB
Table = tblResult
Expand|Select|Wrap|Line Numbers
  1. No; Numeric; PK (Primary Key)
  2. J1; Numeric
  3. J2; Numeric
  4. J3; Numeric
  5. J4; Numeric
  6. J5; Numeric
Expand|Select|Wrap|Line Numbers
  1. SELECT [No],
  2.        [J1],
  3.        [J2],
  4.        [J3],
  5.        [J4],
  6.        [J5],
  7.        [J1]+[J2]+[J3]+[J4]+[J5] AS [Total]
  8.        (SELECT Count(*)
  9.         FROM [tblResult]
  10.         WHERE ([J1]+[J2]+[J3]+[J4]+[J5])>[Total])+1 AS [Rank]
  11. FROM [tblResult] AS [tblOuter]
Credit goes to Rabbit for introducing me to this method in Adding a Rank column to a report
Feb 7 '08 #2
NeoPa
32,556 Expert Mod 16PB
Another method can be found in post #2 of How to rank a query in MS Access?
You can choose which method you prefer.
Feb 7 '08 #3
Thank you very much sir for the immediate response. I'll try this.
Feb 8 '08 #4
NeoPa
32,556 Expert Mod 16PB
No worries. I'm pleased to help :)
Feb 8 '08 #5

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

Similar topics

3
by: Impakt | last post by:
Hi all... I'm making a database which is a survey on coastal safety. One of the questions asked is what activities the respondant uses the coast for...I have the following: Fishing Surfing...
3
by: CSDunn | last post by:
Hello, I have 14 fields on a report that hold integer values. The field names use the following naming convention: T1Number, T2Number ....T14Number. I need to get a 'sub total' of all fields as...
2
by: mhodkin | last post by:
I created a query in which I have grouped data by City. I wish to calculate the percent of each value, e.g. City/(Total count of all Cities), in tbe next column of the query. I can't seem to...
1
by: z.ghulam | last post by:
I've designed a query which merely counts the number of different types of orders. What I am after is a way of getting a Grand Total which will be the Sum of all the totals. It sounds simple...
6
by: sara | last post by:
I hope someone can help with this. Our director wants to have a report that will have the departments (Retail stores) across the top, stores down the side and the RANKING of the YTD dept sales...
1
by: Bob Alston | last post by:
I need to produce a report like this Color: # % ------ --- --- White 10 20 Black 25 50 other 15 30 ---- ---- Total 50 100
2
by: Jana | last post by:
Using Access 97. Background: I have a main report called rptTrustHeader with a subreport rptTrustDetails in the Details section of the main report. The main report is grouped by MasterClientID. ...
3
by: davidhumphrey70 | last post by:
Hi, I am in serious need of some help PLEASE? I have a 4 tables (April data, May data, June data and July data) with numerous fields. Each of the tables has its own "Passed for payment to...
7
by: Ecohouse | last post by:
I'm working on a project that was dropped in my lap. It is in Access 2003. There are short time fields which get calculated values (eg. 1:30). But I will need to total up those values for...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.