Date filter not working correctly
Posted: Fri May 07, 2010 8:31 pm
Some pseudo-code of what works and does not work...
Here are two filter examples of what works: This shows everything from 2010-05-03 to 2010-05-05 for Front
This shows everything on 2010-05-03 for Front
Here are two examples of what does not work:
For both examples, the date filter seems to be ignored - everything for Front and Back is returned, regardless of date.
And the actual SQL that ZM generates for one of the non-working filters:
Here are two filter examples of what works:
Code: Select all
MonitorName = "Front" AND Date >= 2010-05-03 AND Date <= 2010-05-05
Code: Select all
MonitorName = "Front" AND Date >= 2010-05-03 AND Date <= 2010-05-03
Here are two examples of what does not work:
Code: Select all
MonitorName = "Front" OR MonitorName = "Back" AND Date >= 2010-05-03 AND Date <= 2010-05-05
Code: Select all
MonitorName = "Front" OR MonitorName = "Back" AND Date >= 2010-05-03 AND Date <= 2010-05-03
And the actual SQL that ZM generates for one of the non-working filters:
Code: Select all
select E.Id,E.MonitorId,M.Name As MonitorName,M.Width,M.Height,M.DefaultScale,E.Name,E.MaxScore,E.StartTime,E.Length,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where 1 and ( M.Name = 'Station_1' or M.Name = 'Test_Station' and to_days( E.StartTime ) >= to_days( '2010-05-05 00:00:00' ) and to_days( E.StartTime ) <= to_days( '2010-05-06 00:00:00' ) ) order by E.StartTime desc limit 0, 25