>>
>>SELECT field1, field2 FROM (m.TableToSave) GROUP BY field1, field2 having count(*)>1 INTO cursor sqltemp
>>SET SAFETY OFF
>>*CLOSE TABLES ALL
>>Select * from sqltemp into table (m.tableToSave)
>>CLOSE TABLES ALL
>>
>>>The SQL below crashes on the 'GROUP BY' line but still runs through to a BROWSE statement below the SQL.
>>>Duplicates are not removed in the result. When I close the BROWSE window, the GROUP BY line is highlighted.
>>>
>>>* Remove dupicates
>>>USE (m.TableToSave)
>>>SELECT * FROM (m.TableToSave)
>>>GROUP BY hits
>>>INTO TABLE sqltemp
>>>SET SAFETY OFF
>>>CLOSE TABLES ALL
>>>COPY FILE sqltemp.DBF TO (m.TableToSave)
>>>CLOSE TABLES ALL
>>>
>>>What have I missed?
>
>I didn't know the list all fields rule. Takk.
You're welcome.