piscis Posted July 14, 2003 Posted July 14, 2003 Gentlemen: Could you please let me know the right code for extracting the 20 top most and 20 least profitable customers using the SALES column in Database1 into listbox1 and 2? On listbox1 I need to show: 20 MOST PROFITABLE CUSTOMERS TotalAmount / CustomerName / CustomerCity On listbox2 I need to show: 20 LEAST PROFITABLE CUSTOMERS TotalAmount / CustomerName / CustomerCity Thanks Andy I�m using: VB.NET 2003 Standard Access 2000 Quote
Heiko Posted July 14, 2003 Posted July 14, 2003 Isn't there something like "SELECT TOP 20 * FROM <table> ORDER BY SALES ASC" "SELECT TOP 20 * FROM <table> ORDER BY SALES DESC" (that is SQL for MS SQL Server. COuld be "FIRST 20" in Access Quote .nerd
rufus Posted July 14, 2003 Posted July 14, 2003 If not FIRST 20, Why don't you sort the table using the "total amount" and extract the the first 20 from the table for top and leat 20 from table. Quote Rufus
Heiko Posted July 15, 2003 Posted July 15, 2003 because that would require unnecessary programming and execution time, I believe. :) Quote .nerd
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.