title: How to cast a datetime format to date as string in SQL Server
body: <p>I am struggling to find a solution for the below issue.</p>
  
  <pre><code>date1 = 31-08-2017 12:10:00
  </code></pre>
  
  <p>I want to cast it as string and need to take date (31-08-2017) alone.</p>
  
  <p>This is my SQL statement:</p>
  
  <pre><code>select * 
  from table_name  
  where cast(date1 as varchar) = '2017-08-30'
  </code></pre>
  
  <p>Here '2017-08-30' is string; when I ran the above select command it's showing o records as date1 is <code>varchar</code> but time also is included.</p>
  
  <p>Can anyone tell me how to split date column alone as a string?</p>