Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excluding Deleted Rows from Multi-Table Select
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00322146
Message ID:
00322161
Views:
21
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,
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform