Transaction group expression/SQL item

Trying to set up an expression/SQL item in a transaction group and having problems doing something like the snippet below.

SELECT DATE_SUB({[~]Last Time Scheduled}, INTERVAL 1 WEEK)

The value always results in evaluation error?

The {[~]Last Time Scheduled} is another SQL expression item in the group which currently just does the following and stores the result as a string.

SELECT NOW()

Replacing the “tag” with a string datetime or NOW() solves the problem, but why can’t I use a tag value?

Using MySQL server.

Try putting quotes around it.

SELECT DATE_SUB('{[~]Last Time Scheduled}', INTERVAL 1 WEEK)

1 Like

Thank you, exactly what was required!

Actually thought I tried this though.
Maybe I dropped it as the text is marked as a string (purple text) when quoting it.