I wrote an SQL query which uses data passed in from WTForms as parameters. How do I ensure double quotes on the variable?
q = """
select * from table
where dt_date >= %(date)s""" % {'date':date}
Right now it shows as
select * from table
where dt_date >= 23-06-2016
which then throws error. How to make it become:
select * from table
where dt_date >= "23-06-2016"
'
quotes work too? If single quotes would work I'd recommend using%(date)r
instead ofs
to get the code representation of the string (including string quotes) – Cleotildeclepe