title: SQL Server Select DateTime using like keyword
body: <p>I have a simple table.</p>
  
  <p><img src="https://i.stack.imgur.com/yfu1o.png" alt="Booking Table"></p>
  
  <p>I am trying to fire following select query on this table.</p>
  
  <pre><code>select * 
  from booking
  where bookingdate like '%11%'
  </code></pre>
  
  <p>In output I expect both the records to be displayed. However, to my surprise only top record from the table is displayed.</p>
  
  <p>This behaviour is quite strange. Is it that <code>like</code> keyword doesn't operate properly on <code>DateTime</code> type of column?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>However if I try this (converting <code>DateTime</code> to <code>Varchar</code>)</p>
  
  <pre><code>select * 
  from booking
  where convert(varchar(50), BookingDate, 120) like '%11%'
  </code></pre>
  
  <p>It works!! </p>