Connecting to filter fields

How can i connect the StartMonth, EndMonth variable in this query to the Filter fields?

Select to_char(Date, ‘YYYY-MM’) as Month,count(Distinct(User_ID)) as User from mainorders
Where to_char(Date, ‘YYYY-MM’) >= {{StartMonth}} and to_char(Date, ‘YYYY-MM’) <= {{EndMonth}}
group by to_char(Date, ‘YYYY-MM’)
order by to_char(Date, ‘YYYY-MM’)

also, If I want to keep the variable type of these two variables as text , can i show the text filter for these variables on the dashboard to change the month when this question is added to the dashboard

Hi @avishbhasin
That’s not how Field Filters work - please read this:
https://www.metabase.com/blog/field-filters/index.html