Filter errors when executed, but 'LIST MATCHES' and 'DEBUG' work as expected
Posted: Wed Jan 03, 2024 12:58 am
I'm setting up some annual archive filters. The filters work when selecting 'LIST MATCHES' on the filter page (with the 'System Load' line removed, obviously, to avoid that SQL error), and the 'DEBUG' modal also shows the expected dates; however, executing the filters results in date errors, and the filters subsequently being skipped.
One of the filters:
'DEBUG' modal shows:
Errors in web log:
Suggestions for an alternative filter setup that works, and doesn't require hard-coded dates?
One of the filters:
Code: Select all
System Load less than 7
and ( Storage Area equal to Cam_Garage
or Storage Area equal to Archives-Cam_Garage )
and ( Start Date greater than or equal to first day of January last year
and Start Date less than or equal to last day of December last year )
Code: Select all
SQL SELECT E.*,M.Name AS MonitorName,M.DefaultScale
FROM Monitors AS M INNER JOIN Events AS E ON (M.Id = E.MonitorId)
WHERE
E.SystemLoad < '7' and ( E.StorageId = '1' or E.StorageId = '5' ) and ( to_days(E.StartDateTime) >= to_days('2023-01-01 00:00:00') and to_days(E.StartDateTime) <= to_days('2023-12-31 00:00:00') ) ORDER BY Id ASC LIMIT 5
Code: Select all
zmfilter_21 5444 ERR Unable to parse date string 'first day of January last year' zmfilter.pl -
zmfilter_21 5444 ERR Error parsing date/time 'first day of January last year', skipping filter 'DeepStorage-Garage' zmfilter.pl -
zmfilter_21 5444 ERR Error parsing Sql. skipping filter 'DeepStorage-Garage' zmfilter.pl -
Suggestions for an alternative filter setup that works, and doesn't require hard-coded dates?