Page 1 of 1

How to use a variable in the middle of an expression?

Posted: Wed Sep 13, 2017 4:42 pm
by gabrielw3n
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?

Re: How to use a variable in the middle of an expression?

Posted: Fri Sep 15, 2017 6:57 am
by Alex K.
Hello,

Could you explain your task in more details, about {doctor} variable, where are you set value for this variable?

Thank you.