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 
How to sort with correct way
Alexis Cao 
    
4 years ago
i have a list with diffirent Unit, like g and kg. i don't know how to sort with descending and ascending.could you help me? thanks a lot, best wishes
Alexis Cao OP  @Reply  
    
4 years ago

Alexis Cao OP  @Reply  
    
4 years ago
it always make the chaos after sorting
Adam Schwanz  @Reply  
           
4 years ago
Make a 3rd column in the table or in a query that has sort order and tell it what to do either individually or with a IIF statement
Scott Axton  @Reply  
        
4 years ago
My standard is to separate out the quantity from the unit designation.
Because you have the unit in the same field that automatically means that the field is text. So you will always sort like:
1, 1.2, 1.5, 10, 11, 2, 2.1 instead of 1, 2, 3, 4
Alexis Cao OP  @Reply  
    
4 years ago
Thanks, Dear Scott

yes, i made the number and unit togther, i also think it is not a better way, i also has other unit name like "ml", also has like "20~30g", also ths "590ml, 20pieces/carton", i don't know what to do next for make it better and easy.

and i think Dear Adam idea is a good idea, but it seems a little harder
Adam Schwanz  @Reply  
           
4 years ago
The best way to do it would be like Scott said to separate them, then you could use a nested IIF statement in a query to assign a number to each unit of measure that you wanted to sort. IIF([Unit]="KG",1,IIF( ... etc
Alexis Cao OP  @Reply  
    
4 years ago
thanks, Dear Adam. i will try it when i am out of office, it seems it can be worked after you told me. thanks
Richard Rost  @Reply  
          
4 years ago
This would be very similar to Convert Currency except instead of money you're dealing with different units of measure.

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/6/2026 6:51:47 AM. PLT: 1s