How to use custom time filter

Hello everyone,

I can’t find a way to use $__timeFilter() and select time by format “now-24h”, I’m sourcing from MySQL database and the date is set as timestamp in the column I’m using to compare dates on the dasboard
I’m trying to source a data from a table in mysql db, but it only works when I select date in grafana as “YYYY-MM-DD 00:00:00”. When I make the source with “now-12h” or “now-2d”, the dashboard doesn’t return any values as if the data isn’t written on the db.
Can anybody here delp me with this? I’ll send here the code I’m using:

SELECT
  ((SUM(tb_prop.qtd_atual) / SUM(tb_tupy.duracao_prod))) * 60 AS TPM
FROM
  tb_producao_operador tb_prop
JOIN
  tb_tupy ON tb_prop.Lote = tb_tupy.Lote
WHERE 
  tb_prop.maquina = 'Produção de Biscoito' AND $__timeFilter(tb_tupy.horario);

This code is running on MySQL (without the timeFilter function, wich is from Grafana), and is also running on Grafana when I select the to and from dates as ‘YYYY-MM-DD 00:00:00’ format.

Edit: the data was written yesterday, so it should work when I select “now-24h” or “now-2d”, but it doesn’t.