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 
Sorting in Reports
Richard Van Wagoner 
      
3 years ago
This is a question concerning Access. I am wondering if there is a way to sort on a calculated field on reports. In my screenshot, I have a calculated field counting the number of notes a person has. I want to sort them ascending or descending. I have looked through my lesson but can't find a solution.
Richard Van Wagoner OP  @Reply  
      
3 years ago

Richard Van Wagoner OP  @Reply  
      
3 years ago

Dan Jackson  @Reply  
            
3 years ago
Put the DSum value in an Aggregate Query and sort in there
Kevin Yip  @Reply  
     
3 years ago
You can only sort by a calculated field if the calculated field is part of the report's record source.  So that will be your goal: put the count into the record source.

You need two queries for this.  First make an aggregate query just for counting the notes:

     SELECT FullNameID, Count(Notes) As CountOfNotes FROM MyTable GROUP BY FullNameID
    
Name this query, say, NoteCountQ.  It will look like:

FullNameID     CountOfNotes
1000           5
1001           2
1002           4
1003           6

Then you join NoteCountQ with your main table:

    SELECT FullNameID, Notes, CountOfNotes FROM MyTable
    INNER JOIN NoteCountQ
    ON (MyTable.FullNameID = NoteCountQ.FullNameID)


which will look like:

FullNameID     CountOfNotes    Notes
1000           5               Note #1 of person# 1000
1000           5               Note #2 of person# 1000
1000           5               Note #3 of person# 1000
1000           5               Note #4 of person# 1000
1000           5               Note #5 of person# 1000
1001           2               Note #1 of person# 1001
1001           2               Note #2 of person# 1001
1002           4               Note #1 of person# 1002
1002           4               Note #2 of person# 1002
1002           4               Note #3 of person# 1002
1002           4               Note #4 of person# 1002
Etc.

Essentially, each person's count appears repeatedly for all his or her notes.  Use this as the record source of your report.  With CountOfNotes part of the record source, you will now be able to sort with it.

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: 6/9/2026 7:37:47 AM. PLT: 0s