I was able to write a SQL query on a SQL Server 2008 database to show the data I need. Now I need to figure out how to export the query into a csv file automatically every night with the date of the export as the file name.
My research tells me there are two ways to do it. One is using task scheduler to run a query file, or to use the server agent. Unfortunately I'm not able to get to agent working so I'll have to figure out how to write a query that will do what I need.