AnsweredAssumed Answered

FM12 ExecuteSQL using IN operator issues

Question asked by SecretWeaponLabs on Aug 7, 2012
Latest reply on Aug 8, 2012 by SecretWeaponLabs

I'm converting a solution which used checkboxes/return-separated-lists to build a relationship and I'm now trying to replace all that work with FMSQL, I can't get the IN statement to work in a dynamic way.

 


This works:

ExecuteSQL ("SELECT "Invoice Number"

FROM Sales

WHERE "Invoice Status" IN ('Sale', 'Void') AND "Invoice Date" BETWEEN ? AND ?";"";"";

"8/1/2012";

"8/17/2012")

 

 

This does not:

ExecuteSQL ("SELECT "Invoice Number"

FROM Sales

WHERE "Invoice Status" IN ? AND "Invoice Date" BETWEEN ? AND ?";"";"";

"Sale, Void";

"8/1/2012";

"8/17/2012")

 

Any ideas or examples of using the IN operator in a SQL statement? Any help is greatly appreciated.

 

Best,

Denis

Outcomes