On Test Query

Some events will continue to trip to alarm operators, even when the account is on test such as Restore Overdue.  This query finds the On Test Status for the alarm customer.

The queries provided should be tested to ensure they meet the customer's specific needs. The company makes no guarantees regarding their accuracy or suitability.

SELECT SYSNO = CASE
	WHEN SYSNO IS NOT NULL THEN "P_ONTEST"
	WHEN SYSNO IS NULL THEN "ONTEST"
	ELSE "NO_ONTEST" END
FROM OUTSRV
WHERE SERIALNO = {ME}
  • SELECT - Starts the Query
  • SYSNO - Column to search.
  • CASE - Starts the variables to search.
  • WHEN SYSNO IS NOT NULL - looks for non-NULL values in the table for the System Number.
  • THEN "P_ONTEST" - The returned value when the SYSNO is NOT NULL.
  • WHEN SYSNO IS NULL - Looks for NULL values in the table for the System Number.
  • ELSE "NO_ONTEST" - Value to return if no values found in the table.
  • FROM OUTSRV - What table to search.
  • WHERE SERIALNO = {ME} - Looks for the alarm's customer account serial number for the same serial number in the table.

Note:  Returned values require a continuous value.  The underscore ensures that the values are continuous.