Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

The sqlFile.execAndReturn... methods query values from whatever Sql table you ask it to. It is not hard-coded to query the TabularDataWithStrings table.

For example, here is a query from one of my own reporting measures that queries the ReportMeterData table:

query = "SELECT SUM(VariableValue) FROM ReportMeterData WHERE ReportMeterDataDictionaryIndex IN (SELECT ReportMeterDataDictionaryIndex FROM ReportMeterDataDictionary WHERE VariableName='Electricity:Facility' AND ReportingFrequency='Run Period' AND VariableUnits='J')"

value = sqlFile.execAndReturnFirstDouble(query).get
puts value