title: Date time format in vb.net
body: <p>I am using following query to get data from SQL Server 2005 using VB.NET 4.0</p>
  
  <pre><code>strSQL = "SELECT EmpNo,
                   Sum(Cast(Substring(OTHours, 0, 3)AS FLOAT)) AS Hour,
                   Sum(Cast(Substring(OtHours, 4, 5)AS FLOAT)) AS Minutes
            FROM   TMSTrans
            WHERE  CONVERT(VARCHAR, datein, 103) &gt;= '01/06/2012'
                   AND CONVERT(VARCHAR, datein, 103) &lt;= '27/06/2012'
            GROUP  BY EmpNo"
  </code></pre>
  
  <p>But incorrect data is returned - I think it's a date range problem. In the table I have a datetime field in which data exists like <code>01/04/2012 00:00:00</code>. Can anyone help?</p>