Hi,
I am new to Grafana so look for guidance in the issue I have been having with $__timeFilter().
I am using Grafana with MySQL.
Grafana version : 6.1.3
SQL:
SELECT EHPT.EQUIP_IDENT AS Equipment, HPT.HEALTH_PROTOCOL_TYPE AS HealthProtocolType, EQUIP.EQMODEL_CODE AS ‘Equipment Type’, AT.START_TIMESTAMP , AT.END_TIMESTAMP AS ‘End Timestamp’, AP.NAME AS ‘Event’, AP.SEVERITY AS Severity
FROM EQUIP_HEALTH_PROTOCOL_TYPE EHPT WITH (NOLOCK)
INNER JOIN ALARM_TRANS AT WITH (NOLOCK)
ON EHPT.EQUIP_IDENT = AT.EQUIP_IDENT
INNER JOIN ALARM_PROTOCOL AP
ON (AT.ALARM_PROTOCOL_IDENT = AP.ALARM_PROTOCOL_IDENT AND AT.HEALTH_PROTOCOL_TYPE_IDENT = AP.HEALTH_PROTOCOL_TYPE_IDENT)
WHERE
$__timeFilter(AT.START_TIMESTAMP)
AND EQMODEL_CODE IN ($equipmodel)
AND EHPT.EQUIP_IDENT IN ($equipid)
AND AP.SEVERITY IN ($severity)
ORDER BY EHPT.EQUIP_IDENT, AT.START_TIMESTAMP
timeFilter() generates time in the following format:
AT.START_TIMESTAMP BETWEEN ‘2019-04-26T18:08:24Z’ AND ‘2019-05-03T18:08:24Z’
timeFilter() picks the dates selected in the time filters but because of the T and Z in the time, the report doesn’t render any result.
Need help figuring this out.