Hi everyone,
I’m encountering an issue with a MySQL query in Metabase when trying to adjust time zones using CONVERT_TZ
. My goal is to adjust a datetime field (mql_at
) from UTC to São Paulo time (America/Sao_Paulo
). However, the query doesn't seem to return the correct results, and I can't figure out why.
Here’s the query I’m using:
SELECT
COUNT(CASE WHEN CONVERT_TZ(mql_at, 'UTC', 'America/Sao_Paulo') IS NOT NULL THEN 1 END) AS "Count"
FROM
Deals
WHERE
{{mql_at}}
AND {{seller}}
AND seller != 'Tanina Rezende'
AND seller != 'Atendimento';
I figured out that the conversion is happenning the way I wanted, but it is still considering the deals from yesterday when I use the filter for today. Can someone help me with that?