Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort with blank rows at bottom

Status
Not open for further replies.

Rauken

Programmer
May 11, 2004
98
SE
I have a query and I have the abilitiy to sort that query on three fields. Some of the records might not have data in all three field e.g.:

column1 column2 column3
1 23 3
3 12 2
1 43

If I sort ascending on column3, row no 3 will show up first becuase it's blank. I want it to be at the end instead but the other two sorted ascended way.

This should be a quite common problem I guess?
 
Hi

Try ORDER BY Nz(Col1,99999999999)

assuming the column to sort on is called Col1, and it is a numberic type

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top