Navigation:  Templates > Guide to all Templates > Additional Libraries and Templates > Crystal8 Class >====== Query (retrieve or set the SQL data query) ====== Previous pageReturn to chapter overviewNext page

Query( | querystring |)

Query  Set or retrieve the SQL data query.

querystring A string constant, variable, EQUATE, or expression containing the SQL query to be sent to the SQL data source. This parameter is optional.

The Query method is used to either get or set the SQL query. If the querystring is omitted from the method call, the current query is retrieved.

Return Data Type: STRING

Example:

formula = oCrystal8.Query()!retrieve query into formula variable

formula = '{{Customer.Country} in [“Australia”]' ! SQL query

oCrystal8.Query( formula ) ! Set the query