• I couldn't get the osql command to work with the variable for the date.

    Here's the osql cmd:

    set var=%date%

    osql.exe -U sa -P password -h-1 -s "," -n -i c:\paymentproductivityreport.sql -o c:\paymentproductivity_%var%.csv