Can anyone please tell me what is wrong with this expression.
"SELECT UserID, Username, IIF (IsNull(SELECT Sharewith FROM SharedDocuments WHERE DocumentCode = 'TEXT' AND DocumentAuto=3 AND ShareWith = UserID), True, False) AS IsShared
IIF (IsNull(SELECT Sharewith FROM SharedDocuments WHERE DocumentCode = 'TEXT' AND DocumentAuto=3 AND ShareWith = UserID), True, False) AS IsShared
Hi,
Please quote the As…… into the pair of "()":
SELECT UserID, Username, (IIF(IsNull(SELECT Sharewith FROM SharedDocuments WHERE DocumentCode = 'TEXT' AND DocumentAuto=3 AND ShareWith = UserID), True, False)) AS IsShared
masteixeira
0 Points
2 Posts
Using IIF in Ms Access
Nov 09, 2012 04:43 PM|LINK
Can anyone please tell me what is wrong with this expression.
"SELECT UserID, Username, IIF (IsNull(SELECT Sharewith FROM SharedDocuments WHERE DocumentCode = 'TEXT' AND DocumentAuto=3 AND ShareWith = UserID), True, False) AS IsShared
FROM Users
WHERE UserID <>'Test'
ORDER BY UserName, IsShared;"
Thank You
ATE
spapim
Contributor
2446 Points
368 Posts
Re: Using IIF in Ms Access
Nov 09, 2012 05:33 PM|LINK
Try:
IIF (Exists(SELECT Sharewith FROM SharedDocuments WHERE DocumentCode = 'TEXT' AND DocumentAuto=3 AND ShareWith = UserID), False, True) as IsSharedHope this helps.
www.imobiliariasemsuzano.com.br
oned_gk
All-Star
31055 Points
6356 Posts
Re: Using IIF in Ms Access
Nov 10, 2012 02:09 AM|LINK
Joint the tables with show all [Users] rows
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Using IIF in Ms Access
Nov 10, 2012 05:36 AM|LINK
Hi,
Please quote the As…… into the pair of "()":
masteixeira
0 Points
2 Posts
Re: Using IIF in Ms Access
Nov 12, 2012 09:58 AM|LINK
Thank you all for your time.