How to compare 2 dates taken from datetimepicker in select query?
<p>I have 2 datetimepickers. In my select query i want to fetch records between these dates.  datatype for date in database in varchar(MAX). For datetimepicker i have set custom format as dd-MM-yyyy. Here is my sql query</p>

<pre><code>SqlDataAdapter da = new SqlDataAdapter("Select custname From tb_customer WHERE date &gt;= '"+dtp_fromdate.Text+"' AND date &lt;= '"+dtp_todate.Text+"'", con);
</code></pre>

<p>For eg: if my start date is 9-06-2012 and to date is 11-06-2012. With the above query it shows me record for 10-06-2012 and 11-06-2012</p>

<p>Incase if my start date is 10-06-2012 and to date is 11-06-2012. With the above query it shows me record for 10-06-2012 and not 11-06-2012</p>

<p>Please help</p>
