cyprus106
Programmer
- Apr 30, 2001
- 654
I'm just trying to order some data correctly. In that respect, I've got the following SELECT statement...
SELECT * FROM BKMASTER WHERE MATKEY='MCCOECO' ORDER BY MEDSTA ASC
The thing is, there are only about 5 two-digit options for MEDSTA: NULL, "OE" "OP" "RT", etc. I want any records with blank MEDSTAs to come first, then records where MEDSTA='RT' to come second, then whatever else. I've tried a few different things, but who am I fooling? I don't have a clue how to do this!
It's worth a star!!
Much appreciated.
Cyprus
SELECT * FROM BKMASTER WHERE MATKEY='MCCOECO' ORDER BY MEDSTA ASC
The thing is, there are only about 5 two-digit options for MEDSTA: NULL, "OE" "OP" "RT", etc. I want any records with blank MEDSTAs to come first, then records where MEDSTA='RT' to come second, then whatever else. I've tried a few different things, but who am I fooling? I don't have a clue how to do this!
It's worth a star!!
Much appreciated.
Cyprus