Postgres daterange with text variables, The column index is out of range

I've looked around at other issues with the same error "The column index is out of range", but they still aren't really clear to me on how to solve this.

I have the following clause:

WHERE '[{{startDate}}, {{endDate}}]'::daterange @> date_created::TIMESTAMP::DATE

and receive error: The column index is out of range: 1, number of columns: 0.

startDate and endDate are text variables. This works fine when I just put MM/DD/YYYY dates instead of the variables.

Thanks for the help

Hi @evandegr
To protect you against SQL injections, the variables are inputted with quoting - for Postgres single '
So you need to do something like this:
concat('[', {{startDate}}, ', ', {{endDate}}, ']')