Gingernut

Execute SQL single double quotes confusing

Discussion created by Gingernut on Jan 18, 2013
Latest reply on Jan 18, 2013 by Gingernut

Filemaker 12 WIndows 7

I have this in a Script to set a variable

 

ExecuteSQL (

"SELECT "Date", "_InvNo", "GrossValue"

FROM "Invoice_Customer"

WHERE "Balance Due" >0 AND "_AccNo" =?" ;

"|" ;

; '5737' )

 

Without the Select statement preceding by quotes I get "Specified Table could not be found" but am getting the same thing for "Date" which is a field in the Invoice_Customer table occurence

 

What is confusing me is if I use fields to set the query it does work

 

The query field contains

SELECT "Date", "_InvNo", "GrossValue"

FROM "Invoice_Customer"

WHERE "Balance Due" >0 AND "_AccNo" =? (no quotes)

 

The Parameters FIELD has 5737 in the first box (no quotes)

 

and there are also fields for each of the field and row separators

 

Result field is calculation that has no quotes or double quotes (borrowed this from another persons file - cannot recall who now)

 

ExecuteSQL(

query;

field separator;

row separator;

parameters[1];
parameters[2];
parameters[3];
parameters[4];
parameters[5])

 

I am clearly missing something in the syntax, can anybody please help me

Cathy

Outcomes