Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Access Ranking Query
Lilly Nguyen 
    
10 years ago
I have a table named "test"  with 5 columns as you see below:

ranking by Buyer then by Date Closed, however, when we get into same buyer and same Date Closed, it ranks the same. I would like to add something that if the Buyer and Date Closed are the same, we will look at the third field " Category",   so those rows in red ink will change ranking from 2 to 3 and so on. What can i do ? below is my query
SELECT (select count(*) from test as test2  
Where test.[Date Closed] > test2.[Date Closed]      
and   test.buyer = test2.buyer ) + 1 AS rank, *  
FROM test;

below is my result from the query
rank Agreement ID Buyer Seller Category Date Closed
1 132638355 HSC-SESS DeRoyal Industries Orthopedic Softgoods & Sports Bracing 9/11/2015
2 158740986 HSC-SESS Medline Industries Personal Protection Apparel 10/16/2015
2 158742627 HSC-SESS Medline Industries Alcohol Prep Pads 10/16/2015
2 158742692 HSC-SESS Medline Industries Pillows 10/16/2015
2 158750751 HSC-SESS Medline Industries Anti Embolism Stockings 10/16/2015
6 202603403 HSC-SESS Ansell Surgical Gloves 11/24/2015
1 205329648 Central Atlantic Health Network Cardinal Health Suction Canisters 11/24/2015
2 222273684 Central Atlantic Health Network Cardinal Health Exam Gloves 12/4/2015
3 278315158 Central Atlantic Health Network Applied Medical Laparoscopic Irrigation 1/21/2016
4 279239488 Central Atlantic Health Network Cardinal Health Crutches 1/25/2016
5 279235376 Central Atlantic Health Network Procter & Gamble Infant Diapers 1/26/2016
  

I hope some one can help me... PLEASE!!!



Reply from Alex Hedley:

You could possibly do it with some vba and a record set

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/16/2026 1:36:06 PM. PLT: 0s