How to use a variable in the middle of an expression?
Posted: Wed Sep 13, 2017 4:42 pm
Hello.
In my data source SQL Script, I would like to check if a variable is null and if it's not, then use the variable to complete a SQL query, something like this:
SELECT (...)
FROM (...)
AND (...)
{doctor != "" ? " AND (something.fk_doctor= {doctor}") : ""}
so, 'doctor' is a variable from stimulsoft and I would like to use it in the middle of the expression below.
It's saying my SQL syntax is incorrect.
How can I use a variable in the middle of an expression but in quotation marks?
In my data source SQL Script, I would like to check if a variable is null and if it's not, then use the variable to complete a SQL query, something like this:
SELECT (...)
FROM (...)
AND (...)
{doctor != "" ? " AND (something.fk_doctor= {doctor}") : ""}
so, 'doctor' is a variable from stimulsoft and I would like to use it in the middle of the expression below.
It's saying my SQL syntax is incorrect.
How can I use a variable in the middle of an expression but in quotation marks?