Is there a way to pass somehow timerange into query variables?

I’m using Query-type variables in my dashboards but I’d like to dynamically filter the query using the selected timerange. Is there any way to pass timerange into sql in query-type variable?

Hello, I’m trying the same thing and found that you can use __timeFrom() and __timeTo()