1 2 Previous Next 18 Replies Latest reply on Jul 6, 2017 9:27 AM by gofmp15

    ExecuteSQL - does this work with a variable field name

    glorifindal

      Hi there,

       

      perhaps one of you clever chaps can show me what I am doing wrong...

      I have a string ( field.list.sub in the example below) that may change, dependent on user selection ...

       

      [code]

      Let([

      _id = $_id ;

      field.list.sub = "\"First Name\",\"Last Name\" " ;

      _qry ="SELECT " & field.list.sub  & " FROM SQLContacts WHERE id=? "

      ] ;

      ExecuteSQL ( _qry ; "" ; "" ; _id  )

      )

      [/code]

      This query returns a ? ...

      When I look at the query itself it show:

      SELECT "First Name","Last Name"  FROM SQLContacts WHERE id=?

       

      Looks correct - please tell me what I am missing and how silly I have been ...

       

      Kindest

       

      G

        1 2 Previous Next