?
Solved

Autonumber undoes sort in Access 2003 table

Posted on 2007-04-04
3
Medium Priority
?
216 Views
Last Modified: 2008-02-01
In Access 2003, I sort my table by product count such as 100 apple, 50 bananas, etc, I want to list my products by the most stock on hand first, I want to add a field that will count the rows. When I add an autonumber field and make it the primary key field, it undoes my product count field sort and makes the products with the least stock on hand first, rather than the way I had it. Is there some way to count the rows w/o undoing my sort?
0
Comment
Question by:contrain
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 18852209
SELECT a.Fruit, (Select Count(b.Fruit) FROM myTable AS b WHERE b.Fruit=a.fruit ) AS Ctr
FROM myTable AS a;
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 18852230

SELECT a.Fruit, (Select Count(b.Fruit) FROM myTable AS b WHERE b.Fruit=a.fruit ) AS Ctr
FROM myTable AS a
GROUP BY a.Fruit;
0
 

Author Comment

by:contrain
ID: 18852266
Thanks,
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question