SQLXRESULT Returns a value located at Col and Row of an SQL Query result table. This SQL query must be specified using SQLXFIRST formula and must be located in Spread Report cell referred to as Cell Reference.
SYNTAX:
SQLXRESULT(SQLXFIRST_Cell,Col, Row)
SQLXFIRST_Cell: A cell reference (i.e. A1, B17) to a cell with the query (SQLXFIRST equation) that you want to get results from.
Col: Column number to retrieve result from
Row: Row number to retrieve result from
NOTES:
You must install the OLE DB driver (provider) for your database on each PC that will use the report. See your database admin for the connection string and driver for any database you want to connect to.
EXAMPLES:
Cell A1 contains the following formula:
SQLXFIRST(1,1,”Provider=SQLOLEDB;Data Source=LT006;initial catalog=Cimplicity;User Id=sa;Password=admin;OLE DB Services =-2;"”,"select max(Temp), min(Temp) from FLOW_LOG where TAG='FIT_305'",2,1)
Cell A2 contains the following formula:
SQLRESULT(A1,2,1)
The SQLXRESULT refers to cell A1, which runs the query specified by SQLXFIRST. The query is set to return 2 results (maximum and minimum). SQLXFIRST in A1 only returns the maximum results. Hence SQLRESULT in A2 returns the minimum result.