AnsweredAssumed Answered

Dynamically selected variables for Execute SQL

Question asked by kigmaker on Dec 1, 2017
Latest reply on Dec 3, 2017 by kigmaker

How do I construct a query to search on more than one value in $$calSelectedUser[N]?

Each value will be delimited by a return.

 

This calculation works, but I have been unable to build one that can use additional values.

 

Let ( [

a_EVENTS = sql.table ( Events::id ) & " a" ;

 

a_DateEnd = "a." & sql.field ( Events::DateEnd ) ;

a_Json = "a." & sql.field ( Events::Json ) ;

a_idUser = "a." & sql.field ( Events::idUser ) ;

 

_id1 = GetValue ( Evaluate ( "$$calSelectedUser[" & WindowLayoutID & "]" ) ; 1 ) ;

_id2 = GetValue ( Evaluate ( "$$calSelectedUser[" & WindowLayoutID & "]" ) ; 2 ) ;

 

_q =

" SELECT " & a_Json &

" FROM " & a_EVENTS &

" WHERE " & a_DateEnd &

" BETWEEN ? " &

" AND ? " &

" AND " & a_idUser & " = ? "

] ;

 

ExecuteSQL (

_q ; "" ; "" ;

GLOBALS::EVENTS_STARTDATE ;

GLOBALS::EVENTS_ENDDATE ;

_id1

)

)

Outcomes