Question is similar to Pythonic way to create a long multi-line string
However, I need to insert a variable wrapped in single quotes into my query. Cant seem to get it to work. Whenver I output my query I am just getting 2019-03-13
and I think it should be '2019-03-13'
businessDate = '2019-03-13'
sql = f"""
#query goes in here.
and businessdate = {businessDate}
"""
error msg:
': ('42883', '[42883] ERROR 4286: Operator does not exist: date = int\nHINT: No operator matches the given name and argument type(s). You may need to add explicit type casts\n (4286) (SQLExecDirectW)')