title: Query records between two dates using VB.net/MS Access
body: <p>i am having table in ms access named as stockitems,
  table structure is..</p>
  
  <pre><code>stdate     stitems
  01-04-2015   Red
  02-04-2015   Blue
  08-04-2015   Green
  01-05-2015   Grey
  02-05-2015   Violet
  09-05-2015   Purple
  04-06-2015   Sky Blue
  </code></pre>
  
  <p>i am using the below code to select records from that table...</p>
  
  <pre><code>Dim report As New CrystalDecisions.CrystalReports.Engine.ReportDocument
      Dim xs, xs2, cmp As String
      xs = date1.Text
      xs2 = date2.Text
      cmp = salsqkrpt.salcom.Text
      Dim cmd1 As OleDbCommand = New OleDbCommand("SELECT * from stockitems  where stdate    between '" &amp; date1.Text &amp; "'and '" &amp; date2.Text &amp; "'",con)
      myDA = New OleDbDataAdapter(cmd1)
      myDataSet = New DataSet()
      myDA.Fill(myDataSet, "stockitems ")
      report.Load(Application.StartupPath &amp; "\stockreport.rpt")
      report.SetDataSource(myDataSet.Tables("stockitems "))
      stckreport.CrystalReportViewer1.ReportSource = report
  </code></pre>
  
  <p>here <code>date1 and date2 was masked textbox</code> ,mask is <code>00-00-0000 (DD-MM-YYYY)</code>
   when excuting this code the report only get from first two strings only that is <code>dd</code> only,when i assign <code>date1=01-04-2015</code> and <code>date2=03-05-2015</code> the result comes like...</p>
  
  <pre><code>      stdate     stitems
      01-04-2015   Red
      02-04-2015   Blue
      01-05-2015   Grey
      02-05-2015   Violet
  
    but my expected result is 
  
      stdate     stitems
      01-04-2015   Red
      02-04-2015   Blue
      08-04-2015   Green
      01-05-2015   Grey
      02-05-2015   Violet
  </code></pre>
  
  <p>it does'nt works as a date please help me out of this problem developers and i am beginner to vb.net. thanks in advance.</p>