Using tags inside SQL WHERE clause in Memory Tags

Getting syntax error when trying to test Memory Tag. Not sure how I can call the tag in the WHERE clause.

ERROR_ExpressionEval(“ERROR: syntax error at or near “05” Position: 91”)

An expression error is a hint that you are using the wrong kind of binding or tag type for SQL. SQL bindings don’t yield expression errors.

Also note that curly braces in simple queries perform stringification and then string substitution into the query text. That is almost certainly going to yield invalid syntax for datetime types without value quotes. That is something that should be a named query parameter.

1 Like

Also, I doubt your “FILTER” clause is syntactically valid. Just include the extra condition in the WHERE clause.

1 Like

1 Like