Dashboard - date parameter issues

Hi, I'm working on creating a dashboard. For the most part, if I'm pulling directly from a table, it will allow me to tie that card into a date range or "month and year" filter in the dashboard.

However, I have several saved SQL queries that are not connecting to the date range and/or month year filters no matter what I try. This is the primary structure of how these date ranges are set up in the stored queries:

[[and to_char(a.dateofnote, 'YYYY-MM-DD') >= to_char({{date03}}, 'YYYY-MM-DD')]]
[[and to_char(a.dateofnote, 'YYYY-MM-DD') <= to_char({{date06}}, 'YYYY-MM-DD')]]

However, in the dashboard, whenever I go to filter on a specific column for these cards, I get the message "This card doesn't have any fields or parameters that can be mapped to this parameter type". These variables are also columns in the query, and they're set as date type. I can't figure out what I'm doing incorrectly, but this is presenting some significant hurtles in creating the dashboards we need. Thank you for any help or assistance.

Which version of Metabase are you running?

Hi Luiggi, I'm running version v1.43.3 (I believe the newest version?). This was an issue I had on our previous version as well.

Hi @saaballergies
I'm not sure fully understand what you're doing, but you'll need to use a Field Filter to get range/period possibilities.
Though, Field Filter syntax is very different from Date variable, so you cannot do what you're doing, but should just do: [[and {{date}}]]

Thank you, Flamber. If I'm understanding correctly, if a query uses a date variable, it cannot connect to a filter in a dashboard because that filter does not recognize the date variable as a mappable parameter.

So, if I do [[and {{dateofnote}}]], how I can structure it to grab all data between two dates? Would I need something like [[and dateofnote > {{dateofnote}}]] [[and dateofnote < {{dateofnote}}]], or do I just do one [[and {{dateofnote}}]] and the dashboard should be able to use that as a range?

EDIT: Essentially, what I'm trying to do with those variables above is select all data that appears between two dates of note. I want this to be a dashboard with other queries/questions, so it can't stand alone as a query. Each week, I'll select the previous weeks dates, so I need it to be dynamic in that respect.

@saaballergies You can use a Date variable, but then you can only use Single Date option on the dashboard, since that's the only thing it supports.

If you use Field Filter, then you can use all dashboard options. Field Filter automatically does all the SQL for you, so you only use [[and {{date}}]], since you specify the actual column in the sidebar.
Read the link I posted, or the documentation for Field Filters: