title: How do i compare the "EndDate" in my database to the current date of today?
body: <p>I want to execute query depending on if EndDate is &lt; Today's date.Here is what i have so far, i need to know how to compare them Thanks!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>//Delete from DB Condition (EndDate)
          if (sqlCon.State == ConnectionState.Closed)
              sqlCon.Open();
          
          SqlCommand sqlCmd = new SqlCommand("DeleteByDate", sqlCon);
          sqlCmd.CommandType = CommandType.StoredProcedure;
          sqlCmd.ExecuteNonQuery();
          sqlCon.Close();
          Clear();</code></pre>
  </div>
  </div>
  </p>
  
  <p>this is the stored procedure.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>ALTER PROC [dbo].[DeleteByDate]
  @AdvID int
  AS
  BEGIN
      UPDATE a SET a.Status = 0
      FROM Advertisement a
      WHERE a.AdvID = @AdvID
  END</code></pre>
  </div>
  </div>
  </p>