Already tried that, thanks. I think we've sorted it by wrapping the select in a SET DELETED ON. Although that had to be done in the grid that receives this command (complicated framework issue).
>Hi Nigel,
>
>I think you may want to drop the HAVING clause and try this WHERE clause:
>
>
>WHERE NOT EMPTY(lk.lk_userid) ;
> AND NOT EMPTY(lk.lk_sessionid) ;
> AND NOT DELETED('testuserlog')
>
>
>Since TESTUSERLOG is your main table and you're not doing any outer joins, this should do the trick.
>
>HTH.
>
>>I am having trouble excluding deleted rows from one table in a four-table select statement. I've tried many different variations but can't seem to get it working. Any ideas?
>>
>>
>>SELECT lk.lk_userid, ul.activity, co.co_name, su.username, DELETED('testuserlog') AS uldeleted ;
>> FROM testuserlog ul ;
>> JOIN seqlock lk ON ul.sessionid=lk.lk_sessionid ;
>> JOIN sequser su ON lk.lk_userid=su.user ;
>> JOIN seqco co ON ul.companyid=co.co_code ;
>> WHERE NOT EMPTY(lk.lk_userid) ;
>> AND NOT EMPTY(lk.lk_sessionid) ;
>> HAVING uldeleted=.F.
>>
>>
>>Thanks,