FileMaker 12和ExecuteSQL

时间:2015-02-18 17:20:01

标签: filemaker sp-executesql

我有这个有效:

ExecuteSQL ( "Select  email_Full from staffing where Branch = ? and EmployeeID  = ? and Title= ?"; " "; " "; "001" ; "33748"; "Supv V" ) 

但我需要第一个参数在001-300范围内;第二个参数> 0,第三个参数可以是Supv,Supv 1,Supv 2,Supv 4或Supv 5

我所有的尝试都失败了。

3 个答案:

答案 0 :(得分:1)

我建议:

 ExecuteSQL ( " Select  email_Full from staffing 
                WHERE Branch = ? 
                AND EmployeeID  = ? 
                AND Title= ?
                AND EmployeeID > 0
                AND Branch BETWEEN 1 AND 300
                AND Title IN (\"Supv\", \"Supv 1\", \"Supv 2\", \"Supv 4\" or \"Supv 5\")"; 
                ""; ""; GetAsNumber("001") ; "33748"; "Supv V" ) 

我不确定EmployeeID检查,我认为你实际上需要NOT NULL而不是> 0

我将Branch作为参数级别的数字转换为over,你必须对IN或LIKE的字符串列表进行测试。

答案 1 :(得分:0)

试试这个:

ExecuteSQL ( "SELECT email_Full FROM staffing WHERE Branch < 300 AND EmployeeId > 0 AND Title LIKE '%Supv%'" ; "" ; "" )

答案 2 :(得分:0)

我取得了进展 ExecuteSQL(“选择email_Full来自人员配置,其中Branch =?和Employee_ID&gt;?和Title LIKE?”;“”;“”;“024”;“1”;“Supv%”)

如果我将FileMaker字段用于分支,则会为所有分支返回完整的电子邮件。我现在需要一个。