Area Open or Close Status Query

Some operational items vary based on the arm/disarm status of the area on the alarm.  This query determines the Open/Close (arm/disarms) status of the Area linked to alarm record.

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 AREAOC = CASE
        WHEN AREAOC = 0 THEN "OPEN"
        WHEN AREAOC = 1 THEN "CLOSED"
        ELSE "UNKNOWN" END
FROM SAREA
WHERE SERIALNO={ME} and AREA = {AR}
  • SELECT - Starts the Query.
  • AREAOC - Column to look for the data.
  • CASE - Starts the variable search items.
  • WHEN AREAOC = 0 - Determines if the Area Open/Close value is equal to Zero, which indicates Open, or disarmed.  
  • THEN "OPEN" - The return value of the Area Open/Close value is TRUE.
  • WHEN AREAOC = 1 - Determines if the Area Open/Close value is equal to One, which indicates Closed, or armed.
  • THEN "CLOSED" - The return value of the Area Open/Close value is TRUE.
  • ELSE "UNKNOWN" - If neither value is not TRUE or the value is not available.
  • END - Closes the CASE.
  • FROM SAREA - Table to search.
  • WHERE SERIALNO={ME} - Looks at the alarm's customer serial number to find the customer's serial number in the table.
  • and - Joins the query parameters.  
  • AREA={AR} - Determines the area on the alarm to search for the value in the table.