AnsweredAssumed Answered

ExecuteSQL - get first row only

Question asked by Paul Jansen on May 22, 2012
Latest reply on May 22, 2012 by rhlilienkamp



I have a calculated query to return the next airings of a broadcast:



~ID = sched::ID_ProgType ;

~SQL = "select "StartTS"

from "Sched"

where "ID_ProgType" = ?

and "StartTS" >= current_timestamp

order by "StartTS" asc" ;

~result = ExecuteSQL ( ~SQL; "|"; "¶" ; ~ID )

] ;





This gives me a list of timestamps which could contain 1000 rows and all I want is the first row/value.


I know I can use getvalue( ~result ; 1 ) in filemaker, but I suspect it would be better to have the SQL do it.


Any Ideas?




Paul Jansen