title: Compare two dates in c# by passing sql query
body: <p>I have a table named RETAILTRANSACTIONTABLE which has a column named BUSINESSDATE which has date in format(yyyy-mm-dd) 2015-05-22.<br/><br/>
  I want to comapre this date with batch.StartDateTime of format (dd-mm-yyyy hh:mm:ss) 05-10-2015 12:09:03.<br/></p>
  
  <pre><code>var dateAndTime = batch.StartDateTime;
  var date = dateAndTime.ToShortDateString();
  string query = "SELECT COUNT(discamount) AS DISCOUNTCOUNT "+
                  " FROM ax.RETAILTRANSACTIONTABLE where "+
                  "(CONVERT(VARCHAR(10),BUSINESSDATE,105) &gt;= '" + date
                  + "') and DISCAMOUNT &gt; 0
  </code></pre>
  
  <p>Using the above query gives me all the values of the column I just want the count of values greater than or equal to batch date</p>