| **Navigation:**  [[templates.htm|Templates]] > Guide to all Templates > [[additional libraries and templates.htm|Additional Libraries and Templates]] > Crystal8 Class >====== Query (retrieve or set the SQL data query) ====== | [[ print print a crystal report .htm|{{btn_prev_n.gif|Previous page}}]][[additional libraries and templates.htm|{{btn_home_n.gif|Return to chapter overview}}]][[selectionformula retireve or set the crystal formula .htm|{{btn_next_n.gif|Next 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**