AnsweredAssumed Answered

Using a Field for "WHERE" Dynamic Input in SQL?

Question asked by beastblittle2 on Nov 9, 2018
Latest reply on Nov 9, 2018 by beastblittle2

Hi All,

Just starting out learning SQL for Filemaker (I actually used SeedCode's SQLExplorer to make it), and my question is this;

 

Is it possible to use a field for dynamic input in the WHERE command?

Right now, I have this

 

Let ( [

ReturnSub = "\n" ;

SQLResult = ExecuteSQL (

"SELECT DISTINCT a.\"Customer #\", a.\"Store Code\"

FROM \"Ad Archives\" a" ;

"    " ; "|*|" ;

""

) ] ; 

Substitute ( SQLResult ; [ ¶ ; ReturnSub ] ; [ "|*|" ; ¶ ]  )

)

Which returns unique Store Codes and their respective Customer number from the table "Ad Archives" and outputs it into a edit box.

 

I basically need to filter these based on the Customer # in the current record (which is stated in a field), so it only shows the stores that pertain to that respective customer. Is there a way I can use WHERE to filter these like that? Or is there another different command to do something like that?

 

Thanks,

Andrew V.

Outcomes