AnsweredAssumed Answered

ExecuteSQL Help

Question asked by bvondeylen on Oct 21, 2013
Latest reply on Oct 21, 2013 by philmodjunk

Title

ExecuteSQL Help

Post

     I am attempting to display a Teacher Name with a student from our Infinite Campus (Microsoft SQL) database within FileMaker Pro 12.

     The 3 Tables in MS SQL are:

     Student          Roster          Section

     personID       personID     

                             sectionID     sectionID

      

     firstName, lastName come from Student

     teacherDisplay comes from Section

     A sample student has an ID (studentNumber) of 37972 (studentNumber is in student table)

     This student is part of Section 859456

     When I manually do the Search in the 3 tables, I get what I want, but when I tried the following ExecuteSQL I have no luck

      

     ExecuteSQL ( 
     "
     SELECT s.lastName, s.firstName, sec.teacherDisplay 
     FROM student AS s
     JOIN roster AS r ON s.personID = r.personID WHERE s.studentNumber = '37972' AND
     JOIN section AS sec ON sec.sectionID = r.sectionID WHERE sec.sectionID = '859456' 
     " ;
      "" ; "" )

Outcomes