>>Is there a way to Select...Distinct from a table and have the resulting records be un-ordered, or following the natural order of the source table? I have tried select ... Distinct and also Select...Group By and the results are always sorted.
>>
>>TIA,
>Jeff,
>
>When you don't specify ORDER BY clause VFP is free to return records in any order. You should not relay on the order of records returned in this case. Here's how you can specify the order you want.
SELECT *, RECNO() AS RecordNo ;
> FROM mytable ;
> INTO CURSOR crsNumbered
>SELECT DISTINCT ... ;
> FROM crsNumbered ;
> ORDER BY RecordNo
Sergey,
I don't think this will DISTINCT the result set. The recno() field will be distinct unto itself so even if all the other fields match, the additional field will cause the record to display, when it shouldn't.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao