You cannot use DELETED() or any other VFP function that has an alias as parameter in select with more that one table. It's covered in the help.
In general, an application should consider any deleted record as non-existentent. The SET DELETED ON will take care of deleted records.
>This SQL pull all records just fine - until I delete a record. After the DELETE, I get back
>no records.
>
>
>select veh.id,;
> veh.internal_id,;
> loc.Caption,;
> veh.year,;
> veh.make,;
> veh.model,;
> veh.color,;
> veh.plate_no,;
> veh.cur_meter,;
> veh.vin;
>from vehicles veh;
>left outer join locations loc on loc.id = veh.location_id;
>where not deleted();
>order by &cSortOrder;
>into cursor temp1
>
--sb--