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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ordering 1

Status
Not open for further replies.

vlitim

Programmer
Sep 2, 2000
393
GB

I have a column in a dbase which can either be, olp,mlp,bp.

This column is one of a few that are displayed when a user searches, at the moment they are being displayed alphabeticaly like bp,mlp,olp.

The problem is that I need to display them in this order bp,olp,mlp. I can't think of anyway to do this?
 
Hi vlitim,
You can add the following order by clause and it will work
-------------------------------------
ORDER BY CASE mat WHEN 'bp' THEN 1 WHEN 'olp' THEN 2 WHEN 'mlp' THEN 3 END
-------------------------------------

Let us know if you still face problem.
 
Thats brilliant, thanks alot never would have figured that out in a million years!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top