I have an SQL query in my python script that starts with the following query:
query = """
DECLARE @StartDate AS Date
SET @StartDate = '2018-10-31'
SELECT ...
FROM ...
...
"""
At the end of my python script im creating two csv files as such:
df.to_csv('C:/path/a_05-11-18.csv', sep=",",
encoding='utf-8', index=False)
df2.to_csv('C:/path/b_05-11-18.csv',
sep=",", encoding='utf-8', index=False)
I would like that when I change the date, in the
SET @StartDate = '2018-11-05'
that my dates in my file name changes accordingly.