title: vb.net SQL checking dates
body: <p>Basically, I have a list of dates in a SQL table with some statistics next to each of them. I want to compare the dates in the table with a certain date I choose. However, my dates in my table are stored as Varchar(50) (and have to be). Apparently I can convert the date in the table into date type but I don't know. Does anyone know how? My current code can be seen below. </p>
  
  <pre><code>   If Chosen = "Today" Then
          DateStop = Today.AddDays(-1)
          Dim objCmd As New SqlCommand("SELECT COUNT(*) FROM Stats where (Date &gt; " &amp; DateStop &amp; ")", objConn)
          MessageBox.Show("SELECT COUNT(*) FROM Stats where (Date &gt; " &amp; DateStop.Date &amp; ")")
          ObjDataReader = objCmd.ExecuteReader
          test = ObjDataReader(0)
          MessageBox.Show(test)
      End If
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p>Edit: I keep getting the error of no data being present when I know that there definitely are dates in my table before and after the day I am trying.</p>