title: How to use between clause for getting data between two dates?
body: <p>I have date field in the database in the format <strong>2012-03-17 19:50:08.023</strong>.</p>
  
  <p>I want to create a select query which gives me the data collected in the <strong>March</strong> month. 
  But I am not able to achieve this.</p>
  
  <p>I am trying following query.</p>
  
  <pre><code>select * from OrderHeader where
  Convert(varchar,UploadDt,103) between '01/03/2013' and '31/03/2013' 
  and DistUserUniqueID like  '6361%' 
  </code></pre>
  
  <p>This query gives me data for all the dates.</p>
  
  <pre><code>select * from OrderHeader where
  UploadDt between '01/03/2013' and '31/03/2013' and DistUserUniqueID like  '6361%' 
  </code></pre>
  
  <p>This query gives me the error as <em>Msg 242, Level 16, State 3, Line 1
  The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.</em></p>
  
  <p>Please help me resolve this.</p>
  
  <p>Thanks in advance</p>