Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

.nerd
Posted

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.

Rufus

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...