Home : SQLXRESULT
Q10961 - INFO: SQLXRESULT

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.

 

Download Example Template: Help_SQLXFIRST.ss3 (Click here for download instructions)

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 4/21/2008 1:47 PM.
Last Modified on 4/21/2008 1:47 PM.
Last Modified by Scott Dorner.
Article has been viewed 3009 times.
Rated 3 out of 10 based on 2 votes.
Print Article
Email Article