SunQuest
 
           Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old October 1st, 2003, 01:53 PM
ven80 ven80 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 ven80 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Alpha / numeric sort

Hi,

I have a column that has values like:

AU-10, AU-8, AU-9, AU-10A, AU-10AA, AU-11, AU-12, AU-12B, B-11, B-11C

When i sort them using order by

I get the result as:

AU-1
AU-10
AU-10A
AU-10AA
AU-11
AU-12
AU-12B
AU-8
AU-9
B-11
B-11C

However, I need the result as:

AU-1
AU-8
AU-9
AU-10
AU-10A
AU-10AA
AU-11
AU-12
AU-12B
B-11
B-11C

If any one can tell how to do it, it would be a lot of help.

Thanks,
Ven80

Reply With Quote
  #2  
Old October 1st, 2003, 04:01 PM
Soky's Avatar
Soky Soky is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Bowling Green KY
Posts: 77 Soky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 49 m 15 sec
Reputation Power: 5
Send a message via Yahoo to Soky
Hi Ven,

I had a similar problem and I solved it by adding another field for sort order.
Field1 | Field2

AU-1 | 1
AU-10 | 10
AU-10A | 10.1
AU-10AA | 10.11
AU-11 | 11
AU-12 | 12
AU-12B | 12.2
AU-8 | 8
AU-9 | 9
B-11 | 11
B-11C | 11.3

Is the only way I know of... well that is unless you want to edit each other records....

AU-01
AU-08
AU-09

======

But I am anticipating you don't want the zero's displayed so when displaying, just replace(rs("field"),"-0","-")

====
My issue was with apparel and size variants (4-s,m,l) and I assigned each variant an option number so the computer would see 4=1,2,3 etc.

Good luck.
__________________
David Francis
Web Application Developer

Air Force trained web designer since 1995 specializing in ASP/SQL online applications for business and organizations.
Partnership with clients for long term and ongoing creation, hosting, marketing and website management.

Reply With Quote
  #3  
Old October 1st, 2003, 04:22 PM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
Have a look at the attached database, best I can come up with.


regards,
__________________
Regards,


John A


Reply With Quote
  #4  
Old October 2nd, 2003, 03:33 PM
ven80 ven80 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 ven80 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I got it sorted out myself. Anyway thanks for the suggestions made.
Soky, my solution was the same as your second suggestion.

and ansentry, I could not open the file you sent.

Anyway thanks a lot to you guys.

Ven.

Reply With Quote
  #5  
Old October 2nd, 2003, 06:49 PM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
The zip file I posted was created using Access97, what version of Access are you using?

I have attached both Access97 and will post Access2000 next.


I am very surprised that you could not open either the zip or access files.

Reply With Quote
  #6  
Old October 2nd, 2003, 06:50 PM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
Here is 2000

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Alpha / numeric sort


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway