How to reference a tag's path in the SQL Query on that tag

I have a Query Tag and I would like to refer to the tag’s path in the query. Is this possible? I have tried a few syntaxes but I either get null/error or just the tag’s name and not its full path.

SELECT PreviousValue 
FROM Table 
WHERE TagPath = '{[.]ThisTag.Path}'

I think the only way you could do that would be to make the tag from a UDT and then reference the UDT specific parameters for PathToTag and PathToParentFolder.


Thank you. I think for this particular project I won’t set up a UDF, but it’s good info to have for next time.