AnsweredAssumed Answered

Using Variables in SQL Query

Question asked by sccardais on Sep 20, 2015
Latest reply on Sep 21, 2015 by sccardais

Is it possible to use variables in SQL queries?

 

In my example below, If I replace $$P1End with a date wrapped in single quotes such as '9/20/2015', I get an accurate result. If I set a variable $$P1End with a date, the query returns ?

 

ExecuteSQL ("SELECT COUNT (OrgID)

FROM ABC_ORGs

WHERE \"Date Ordered\" < $$P1End AND Status = 'Client'  ";"";"")

 

Are variables not allowed in SQL queries or is my syntax incorrect?

Outcomes