Dec 23, 2002 #1 Mothra Well-known member Joined Nov 26, 2002 Messages 173 Location Fresno, California Can you set two fields to order records by? like this: ORDER BY fldOne ACS, ORDER BY fldTwo Asc or something like that?
Can you set two fields to order records by? like this: ORDER BY fldOne ACS, ORDER BY fldTwo Asc or something like that?
Dec 23, 2002 #2 Divil Well-known member Joined Nov 17, 2002 Messages 2,748 ORDER BY fldOne, fldTWO DESC etc
Dec 26, 2002 #3 dejota6 Member Joined Oct 24, 2002 Messages 16 Location Sherwood, Arkansas (outside of Little Rock) 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 Code: sql = "Select PR_LNAME, PR_FNAME, PR_MINIT, PR_NUM " _ & "from IGYPRMSD1 order by PR_LNAME asc, PR_FNAME asc;"
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 Code: sql = "Select PR_LNAME, PR_FNAME, PR_MINIT, PR_NUM " _ & "from IGYPRMSD1 order by PR_LNAME asc, PR_FNAME asc;"
Dec 30, 2002 #4 Nerseus Danner Joined Oct 22, 2002 Messages 2,547 Location Arizona, USA User Rank *Expert* I know in SQL Server you can also ORDER BY ordinal position, such as: Code: 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
I know in SQL Server you can also ORDER BY ordinal position, such as: Code: 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