R.SQLRESULT is a custom report vbscript function that returns the result of the specified SQL query.
Syntax
=R.SQLRESULT("SQL Statement")
Where
SQL Statement is a valid SQL query that is executed against the current Job Cal/Plus Database.
Examples
=R.SQLRESULT("SELECT COUNT(*) FROM WO") - returns the number of records in the WO table.
=R.SQLRESULT("Select Count(*) FROM WO WHERE [DateComplete ] >= #SD# and [DateComplete ] < #ED#") - returns the number of work orders that have a DateComplete in the report date range. #SD# is replaced with the report start date and #ED# is replaced with the report end date.
Notes
Use Locate, SQL Results in the Custom Report Designer to locate the formula into the report.