I have created the following batch file to run a query, and save the results in a .csv file.
sqlcmd -S MyLogin -i LocationToSql -E -o "C:\Users\user\Desktop\query result\result2-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%.csv" -s";" -w 700
Right now, i'm saving the result as: result2-2017-06-21.csv
However, i would like it to be: result2-2017-06-20.csv
But i don't know how to subtract 1 day of the command.
The date is defined like:
%date:~-4,4%-%date:~-7,2%-%date:~-10,2%