Cannot Use Relative Date Filter with Native SQL Question

Hi.

Is it not possible to use relative date filter with question made with native sql?

As below, the first box which can use relative date filter is made with simple question.
On the other hand, the second box cannot use the filter is from native sql.
Of course, both are using the same table and the column is date type.

Plus, I checked I should use field filter when I want to use date filter with native sql, but I faced error when I join more than 2 tables.

select * from tmp_date a join tmp_table b on a.date = b.date_ymd  where {{date_var}}

image

for sure, the date column exist in tmp_date.

I found that it is not able to use table alias when I use field filter.

And that solved my problem.

Thanks :slight_smile:

And just for reference for anyone else:
https://www.metabase.com/learn/building-analytics/sql-templates/field-filters.html#field-filter-gotchas