>>In addition to Michel's observation, use field names in GROUP BY clause, not numbers.
>
>Are you saying this as a matter of Best Practice, or because it absolutley does not work in Sql Server?
>
>I just want to understand the context of your suggestion.
>
>
>On a related matter, I seem to recal a situation in VFP where you *have* to use numbers in either the Order or Group clause. Perhaps it was when doing a Union. I don't recall all the details.
>
>.
I think best practice is to use field names in SQL Server.
See also this very interesting story
http://bradsruminations.blogspot.com/2010/01/trolls-puzzle-sql-fable.htmlIn the UNION clause in VFP you have to use ordinals.
If it's not broken, fix it until it is.
My Blog