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:
  #1  
Old February 16th, 2004, 06:22 PM
3.14 3.14 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 3.14 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorting ascending ignoring null values

Can you make a query ignore null values when you sort in ascending order?

I want to sort a list by number and only about 10 values have numbers assigned, the others are null. I want the whole list displayed, and I want the numbers in descending order from top to bottom. However, every time I do this, the null values appear up the top and I have to scroll to the bottom. Can I make those null values appear after the other values?

Thanks in advance.

Reply With Quote
  #2  
Old February 17th, 2004, 02:26 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 280 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 10 sec
Reputation Power: 6
You can use the nz(fieldname,0) to return zerovalues for null value fields and then use the descending order,
Ex.
select nz(fieldname,0) from table order by nz(fieldname,0) asc


you can replace 0 with any value depending upon your requirement of sort order
__________________
V.Subramanian

Reply With Quote
  #3  
Old February 17th, 2004, 05:13 PM
3.14 3.14 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 3.14 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by supersubra
You can use the nz(fieldname,0) to return zerovalues for null value fields and then use the descending order,
Ex.
select nz(fieldname,0) from table order by nz(fieldname,0) asc


you can replace 0 with any value depending upon your requirement of sort order



Thanks. I had originally set them all to 99 and made the default value of 99. But your suggestion works just as well.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Sorting ascending ignoring null values


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 | 
  
 





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