Calculate Number of Days
<p>I want to calculate the number of days from a field 'complaintdate' in my SQL database.
In this field store the date in which users register complaint.  I want to see the complaints pending 20 days and more from current date.</p>

<p>Is there is any other function or method to count number of days?
the code i used is</p>

<pre><code>cmd = new SqlCommand("select complaintdate from complaintregister where compstatus='Attended &amp; Open'", con);
rd = cmd.ExecuteReader();
if (rd.Read())
{
    string s = rd["complaintdate"].ToString();
}
</code></pre>

<p>i displayd 's' by</p>

<pre><code>Response.Write(s);
</code></pre>

<p>and its diplayed in this format 4/5/2011 12:00:00 AM </p>

<p>`</p>
