Alerts with condition on date instead of time

I have this time series set up in grafana, but the time points are dates from mysql, not timestamps. When I setup an alert that for example checks the maximum value between yesterday and today, then it keeps taking the whole time series query to find the maximum value, i.e. it does not restrict the query to the time specified in the alert condition. Is this a bug where grafana handles the date type of mysql wrongly or did I forget something?

This is the alert


You can see that the maximum value is 211 when testing the rule, but on the chart you see that the last few points don’t even come close to 211. The 211 is a maximum value over the whole time series of the query.


Anyone that can help me figure out why the condition is not restricted to the last 48 hours?


when adding $__timeFilter(Date) in the where clause of the query, it seems to work now