AnsweredAssumed Answered

Pass result of CF to ExecuteSQL parameters

Question asked by Nick Austen on Dec 22, 2016
Latest reply on Dec 22, 2016 by Nick Austen

Hi all

I am trying to create a dynamic ExecuteSQL statement, where the parameters are set up using a custom function. With no luck.

 

The cf "FormSQLRCParams > _params" gives back the value expected (Row1_Name; From_Date; To_Date; Col1_Name).

- when I use the cf I get an empty field  (_params)

- if I substitute in the actual parameters (Row1_Name; From_Date; To_Date; Col1_Name) - I get the value I want (commented out below)

 

Any help much appreciated!

 

Calculated Field:

Let(

[

_params = FormSQLRCParams ( "Location";1;1);

 

_sqlstatement = "SELECT

SUM(Unit_Amount)

FROM

Purchase_Orders_Lines

WHERE

Tracking_Department = ?

AND PO_Date >= ?

AND PO_Date <= ?

AND

PO_State_Short = ?"

];

 

ExecuteSQL ( _sqlstatement;"";"";

_params

//Row1_Name; From_Date; To_Date; Col1_Name

)

) //Let

Outcomes