Jim Shelton
Jim Shelton

Reputation: 1

FileMaker 12 and ExecuteSQL

I have this that works:

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

but I need the first parameter to be within the range of 001-300; the second parameter to be >0 and the third could be Supv, Supv 1, Supv 2, Supv 4 or Supv 5

All my attempts fail.

Upvotes: 0

Views: 93

Answers (3)

Nicolai Kant
Nicolai Kant

Reputation: 1391

I suggest:

 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" ) 

I am not sure about EmployeeID check, I think you are actually need NOT NULL instead of >0

I casted Branch as number at parameter level, overwise you will have to test it against a list of strings with IN or LIKE.

Upvotes: 1

Jim Shelton
Jim Shelton

Reputation: 1

I have made headway with ExecuteSQL ( "Select email_Full from staffing where Branch = ? and Employee_ID > ? and Title LIKE ?"; " "; " "; "024" ; "1"; "Supv%" )

If I use the FileMaker field for branch it returns email full for all branches. I need it one at at time.

Upvotes: 0

CristosLC
CristosLC

Reputation: 422

Try this:

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

Upvotes: 0

Related Questions