Subject Re: SQL to Show/Hide cells based on relation
Author Pavel Kutakov
You should move user name condition to the join part. Here is a
working query:

SELECT DISTINCT
D.RID,
IIF((U.LOGIN_ID is not null), D.FYL_NMBR, '<Blocked>') AS FYL_NMBR,
IIF((U.LOGIN_ID is not null), D.TITLE, '<Blocked>') AS DOC_TYT
FROM
DOCS D
LEFT JOIN DOC_2_PRM_GRP G ON G.RID = D.RID
LEFT JOIN USR_2_GRP U ON U.GRP_NM = G.GRP_NM AND U.LOGIN_ID =
'DAFFY_DUCK'
ORDER BY D.RID


Best regards
Pavel Kutakov
SQLLY Development
InterBase/Firebird Development Studio - complete development solution
http://www.sqlly.com