title: SQL Select error and OUTPUT
body: <p>I need to query a database for some information and then store it into a .csv file in case the dispatch system goes down. I'm running into some issues with the <code>select</code> query as well as the <code>output</code> statement. Here is what I have:</p>
  
  <pre><code>SELECT cmpy, veh, driver, attendant, trainee, unit_code, startdate 
  FROM vehicle_schedule 
  WHERE startdate &gt;= 2015-07-22
  ORDER BY cmpy, veh
  </code></pre>
  
  <p>The error that I am getting is this:</p>
  
  <pre><code>Msg 245, Level 16, State 1, Line 1
  Conversion failed when converting the varchar value '2010-05-25' to data type int.
  </code></pre>
  
  <p>I'm not sure what is going on and exactly how to fix the issue. Also I can't get it to output to a file, I get the error: <code>incorrect syntax near 'OUTPUT'</code></p>
  
  <p>Any help would be amazing!</p>