title: Setting a variable date in SQL
body: <p>In SQL Server Management Studio, I am trying to reference a specific date and time, using a variable for the date, as shown below.</p>
  
  <pre><code>Declare @specified_date Date
  set @specified_date = '07-01-2013'
  
  Select * 
  from etc
  Where CreatedDate &gt; CONVERT(datetime, @specified_date &amp; '00:00:00.000' )
  </code></pre>
  
  <p>This code is not working, and I am receiving this error: </p>
  
  <blockquote>
    <p>The data types date and varchar are incompatible in the '&amp;' operator.</p>
  </blockquote>
  
  <p>The data being used has both a date and time code on it, and instead of changing multiple queries, I'd like to be able to just define the date once and have the variable carry it across. If anyone knows of a solution, that would be great.</p>