elucero
asked on
ADO.NET Query issues with 'Union' and 'In'
I'm using an ado.net source to get ad groups. I'm having issues with the queries below. I cannot use an 'in' or a 'union' to get multiple groups. Any suggestions?
SELECT displayName, Mail, telephoneNumber, name, sAMAccountName, givenName, sn, distinguishedName
FROM 'LDAP://xxxx'
WHERE objectClass='user' AND memberOf in('CN=AGrp-aaaa','CN=AGrp -bbb')
SELECT displayName, Mail, telephoneNumber, name, sAMAccountName, givenName, sn, distinguishedName
FROM 'LDAP://xxxx'
WHERE objectClass='user' AND memberOf = 'CN=AGrp-aaaa'
union all
SELECT displayName, Mail, telephoneNumber, name, sAMAccountName, givenName, sn, distinguishedName
FROM 'LDAP://xxxx'
WHERE objectClass='user' AND memberOf = 'CN=AGrp-bbbb'
SELECT displayName, Mail, telephoneNumber, name, sAMAccountName, givenName, sn, distinguishedName
FROM 'LDAP://xxxx'
WHERE objectClass='user' AND memberOf in('CN=AGrp-aaaa','CN=AGrp
SELECT displayName, Mail, telephoneNumber, name, sAMAccountName, givenName, sn, distinguishedName
FROM 'LDAP://xxxx'
WHERE objectClass='user' AND memberOf = 'CN=AGrp-aaaa'
union all
SELECT displayName, Mail, telephoneNumber, name, sAMAccountName, givenName, sn, distinguishedName
FROM 'LDAP://xxxx'
WHERE objectClass='user' AND memberOf = 'CN=AGrp-bbbb'
ASKER
the error is ADsDSOObject failed with no error message available
I used the parentheses and or and got the same message
I used the parentheses and or and got the same message
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
>I cannot use an 'in' or a 'union' to get multiple groups.
Why's that? Is there an error message that is returned when you attempt this? Copy-pasting that error message into this question would greatly help.
Also if the 'LDAP://xxxx' values above are identical, and you can't use IN (still don't know why), try using order of precedence parentheses ( ) and an OR..
Open in new window