title: how to compare the time and date using mysql and c#
body: <p>I have a table <code>logout</code>  with columns </p>
  
  <pre><code>logout_id
  logout_datetime  values format like this(2011-09-08 11:09:09)
  </code></pre>
  
  <p>and i want to compare the logout_datetime with today date and time also....</p>
  
  <p>for that i have done like this....</p>
  
  <pre><code>string dtStartString = DateTime.Today.ToString("yyyy-MM-dd");
  string timeonly = DateTime.Now.ToShortTimeString();
  
  string sql = @"select logout_id"; 
  sql+= string.Format("where logout_datetime = '{0}'",dtStartString );
  </code></pre>
  
  <p>but it will compares only date in <code>logoutdatetime</code> ,its wrong i want to compare the time also</p>
  
  <p>how can i do this..</p>
  
  <p>would any one pls help on this...</p>