How to implement date filter in a dashboard with widget created via a custom query?

Hi everyone,

i have this query

Blockquote
SELECT "dm_a0000125955"."lv2_crash_summary"."time" AS "tempo",
"dm_a0000125955"."lv2_crash_summary"."speed" AS "speed",
'Test Date Filter'
FROM "dm_a0000125955"."lv2_crash_summary"

i want to use the variable called "tempo" as a dashboard filter, but when i try to add it give me "no valid field".
The field "time" is already in a date format
how can i solve it ?

thank you

SELECT "dm_a0000125955"."lv2_crash_summary"."time" AS "tempo",
"dm_a0000125955"."lv2_crash_summary"."speed" AS "speed",
'Test Date Filter'
FROM "dm_a0000125955"."lv2_crash_summary"
WHERE "dm_a0000125955"."lv2_crash_summary"."time"  = {{tempo_variable}}