>I thought the same but was told by Aleksey that in VFP the field name takes precedence over field alias. IOW, 'ORDER BY Fld1' references fileds 'cGrp.fld1' which is not a part of result set.
Thank you Sergey.
But then there is a documentation issue. In HELP under SET ENGINEBEHAVIOR topic for ORDER BY is metntioned that ONLY if you have SELECT DISTINCT "ORDER BY command will generate an error if the specified ORDER BY field is not in the SELECT field list"
I do not have DISTINCT clause in that SELECT :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.