AnsweredAssumed Answered

ExecuteSQL - does this work with a variable field name

Question asked by glorifindal on Jul 6, 2017
Latest reply on Jul 6, 2017 by gofmp15

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

Outcomes