Using OPENQUERY for AD filtering

Hello! I’ve been playing around with OPENQUERY in Ignition to pull more information from users who reside in Active Directory. I’ve had success pulling their names, employee IDs, etc., however, I am not able to query using tag/component values.

For example, lets say I have an employee ID that is 101. I can query it using:
SELECT * FROM OPENQUERY (AD,'Select cn
FROM ‘‘LDAP://myserver.local’’
WHERE objectClass = ‘‘User’’ AND employeeID = 101
ORDER BY cn ASC ') AS tblAD

However, if I use a tag/component instead of directly writing the number, the query fails. I believe this is because there are many single and double quotes involved that it cannot distinguish it is a tag/component.

Is there any workaround for this? Can a transaction group be created that can do OPENQUERY?
(The only workaround I’ve found so far is to have the query as a string and concatenate the tag or component’s value)