Chester Friesen wrote: > BTW, what does the 4 do after the Order By, also the 1 after the Desc? >
It allows you to specify the column to be used by column reference number, as in the 4th column from your SELECT statement, as opposed to naming the field specifically. But be careful: if you come back to this query later and add something before the last field listed in the SELECT statement, you may not be referring to the same field anymore. For example: select cName, dDOB, cEyeColor, cHairColor, sum(iTestScore) from Dating group by 1,2,3,4 order by 4 ...and then you go and add field like so: select cName, dDOB, cEyeColor, cHairLength, cHairColor, sum(iTestScore) from Dating group by 1,2,3,4,5 order by 4 ...you're going to get a different sort order, with the first query sorting on cHairColor, whereas the second query sorts on cHairLength. (That is of course unless cHairColor = 'BLONDE'.....hahaha) -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com "Work smarter, not harder, with MBSS custom software solutions!" _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.