Mothra Posted December 23, 2002 Posted December 23, 2002 Can you set two fields to order records by? like this: ORDER BY fldOne ACS, ORDER BY fldTwo Asc or something like that? Quote Being smarter than you look is always better than looking smarter than you are.
*Gurus* divil Posted December 23, 2002 *Gurus* Posted December 23, 2002 ORDER BY fldOne, fldTWO DESC etc Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
dejota6 Posted December 26, 2002 Posted December 26, 2002 Yes Mothra you can. I have used that in many cases in some of my code. I will include a sample piece of code that I run all the time sql = "Select PR_LNAME, PR_FNAME, PR_MINIT, PR_NUM " _ & "from IGYPRMSD1 order by PR_LNAME asc, PR_FNAME asc;" Quote
*Experts* Nerseus Posted December 30, 2002 *Experts* Posted December 30, 2002 I know in SQL Server you can also ORDER BY ordinal position, such as: SELECT Field1, Field2 FROM Table1 ORDER BY 1 asc, 2 desc -- or is it 0 asc, 1 desc? This comes in handy if you have a complex SELECT, such as a CASE statement or subselect. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.