Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Sort by ASC and (null)?
Old 06-19-2007, 12:57 PM Sort by ASC and (null)?
Skilled Talker

Posts: 60
Name: Nick Martin
Trades: 0
Hey Everyone!

Wondering if this is even possible. I have a table with 2 columns (WO# , SchedFinish) I am ordering by SchedFinish ASC. However some of the SchedFinish values are null. I would like them at to fall after the non-null values. Is this possible.

SELECT WO, SchedFinish FROM "work"
ORDER BY SchedFinish ASC

So this is basically what I have. Can this be modified to sort the null values to the end?
SpudNik is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-19-2007, 01:07 PM Re: Sort by ASC and (null)?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
ORDER BY IsNull(SomeField, 'zzzzzzzzzzzzzzzzzz')

Also, you don't need to specify ASC in the sort, because that's the default. You need to put DESC to override the default, but ASC is assumed.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-21-2007, 04:33 PM Re: Sort by ASC and (null)?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
SELECT WO, SchedFinish FROM "work" ORDER BY NOT IsNull(SchedFinish) DESC, SchedFinish [ASC];
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Sort by ASC and (null)?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26191 seconds with 12 queries