473,405 Members | 2,160 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,405 software developers and data experts.

Changing 5098 to the Last Number in a Rank Plus One?

Would someone please take a look at my database and help me find a way to change the “5089” to just be the last number in my ranking.

So in 3MonthRank all the “5089’s” should be 692
And in 6MonthRank all the “5089’s” should be 750

I’m hoping there is a easy way to do this.

The attached will show you exactly what I’m asking

I really appreciate you taking the time to help.

Below is the code if that helps.

[sql](Select count(*) from Wholesale_Group_1_export_tbl as B where Wholesale_Group_1_export_tbl.[3MonthTotalRecord$] < B.[3MonthTotalRecord$]+1) AS 3MonthRank,
Wholesale_Group_1_export_tbl.[3MonthTotalRecord$],
Wholesale_Group_1_export_tbl.[3MonthTotalRecords#],

(Select count(*) from Wholesale_Group_1_export_tbl as B where Wholesale_Group_1_export_tbl.[6MonthTotalRecords$] < B.[6MonthTotalRecords$]+1) AS 6MonthRank,
Wholesale_Group_1_export_tbl.[6MonthTotalRecords$],
Wholesale_Group_1_export_tbl.[6MonthTotalRecords#],

(Select count(*) from Wholesale_Group_1_export_tbl as B where Wholesale_Group_1_export_tbl.[9MonthTotalRecords$] < B.[9MonthTotalRecords$]+1) AS 9MonthRank, Wholesale_Group_1_export_tbl.[9MonthTotalRecords$], Wholesale_Group_1_export_tbl.[9MonthTotalRecords#], (Select count(*) from Wholesale_Group_1_export_tbl as B where Wholesale_Group_1_export_tbl.[12MonthTotalRecord$] < B.[12MonthTotalRecord$]+1) AS 12MonthRank, Wholesale_Group_1_export_tbl.[12MonthTotalRecord$], Wholesale_Group_1_export_tbl.[12MonthTotalRecords#] INTO RankTable_tbl

FROM Wholesale_Group_1_export_tbl
ORDER BY Wholesale_Group_1_export_tbl.[3MonthTotalRecord$] DESC , Wholesale_Group_1_export_tbl.[6MonthTotalRecords$] DESC , Wholesale_Group_1_export_tbl.[9MonthTotalRecords$] DESC;[/sql]
Attached Files
File Type: zip NewDB2.zip (171.0 KB, 116 views)
Jan 10 '11 #1
2 1333
ADezii
8,834 Expert 8TB
If you want ALL 5089s in the [3MonthRank] Field to be changed to 692, then:
Expand|Select|Wrap|Line Numbers
  1. UPDATE RankTable_tbl SET RankTable_tbl.[3MonthRank] = 692
  2. WHERE RankTable_tbl.[3MonthRank]=5089;
Jan 10 '11 #2
Rabbit
12,516 Expert Mod 8TB
You put your +1 in the wrong place. It needs to add one after the count is returned, not during.
Jan 10 '11 #3

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

Similar topics

4
by: JaNE | last post by:
as 1st, sorry on my clumsy english (now I realy miss some words) I have one language specific problem with my site. I would like to tell how meny pictures someone have in his or her gallery and I...
2
by: Seal | last post by:
Hi, May I know how to change the default port number to other number (default is 80) when I start an asp.net web application using VS.net? Thanks. Regards, Seal
8
by: Robert Misiak | last post by:
Is it possible to manually change the auto-build number used in VS.NET? Thanks, Robert
2
by: aliensite | last post by:
How do I get expression to output "24"? <script> var str = "dog3cat24z" var re = /\D/g; var lastNum = str.replace(re, "") // lastNum should be 24 document.write(lastNum) </script> Thanks
3
by: NV | last post by:
I've a table called GReg with the fields GNumber, ControlNumber, ArticleCode, ProdNumber and Date. In a form I select the ArticleCode from one combo box, and I define the number of records to...
3
by: Greg Smith | last post by:
I would like to change the version number that you get as the first part ('1.0.') of string that is returned by "Application.ProductVersion". Where do I change this?
4
by: tony curtis | last post by:
I have a list of order numbers and want to increase the last number used by 1 and store the latest number in a table. Autonumber does not work for me as all the data is in a table already. New...
8
by: blazo | last post by:
its here why isit like that #include <stdio.h> int z; int y; void reverse_order(int x,int y) { for (y = 9; y >=0; --y) { printf("%d \t",x);
3
by: David Davis | last post by:
Hello, I am somewhat new at access 2003 I want to retrieve last sequential number in Field1 in Table1 to put in Field 3 of Table2. How do I do this? I tried Nz(DMax("","Table1"))+1 in the...
3
by: thesinnerishere | last post by:
this is regarding the last number standing problem. it requires the number in an array to be extracted at a specified position . then the array needs to traverse through the right position of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.