Forum Moderators: open

Message Too Old, No Replies

Need help with a db select statement

         

kevinj

6:14 pm on Jul 4, 2004 (gmt 0)

10+ Year Member



I have written some ASP that selects all records from a db and orders by some fields. The problem is that some of author_1 fields are NULL. So when I display the results, it displays A-N, the author_1 = NULL records, then O-Z. I want it to display the author = NULL records first then A-Z. Here's my select statement:

set RS = DBPages.execute("SELECT * FROM masterindex ORDER BY Author_1,Author_2,Author_3,Volume,Number ASC"

Any ideas how I can get it to select A-Z with the author_1 = NULL records first?

Thanks,
Kevin

ogletree

6:38 pm on Jul 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This works for me in access. I don't know if it translates over very well.

SELECT * FROM masterindex ORDER BY masterindex.Author_1, masterindex.Author_2, masterindex.Author_3, masterindex.Volume, masterindex.Number;