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

Stimulsoft Reports.WEB discussion
Post Reply
gabrielw3n
Posts: 14
Joined: Mon Aug 21, 2017 5:10 pm

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

Post 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?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

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

Post 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.
Post Reply