title: How to format a query to return data dating no later than 90 days on a .aspx web page with DropDownList control parameter?
body: <p>The variable <strong>@status</strong> takes three values, C, N, V on one web page if selected to call the query below.
  How to format the query to return data dating no later than 90 days in the query below in order to return if selected, item with a date (entry_date) no later than 90 days for only <code>@status = 'C'</code>, but for other statuses V and N to return data without any date constrain?</p>
  
  <pre><code>    &lt;asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="&lt;%$ ConnectionStrings:MyConnectionString %&gt;"  
  
   SelectCommand="SELECT W.order_id, w.entry_date, w.s_num, w.prot_num, w.i_num, w.phm_num, w.status, w.Comments, w.UName, w.prStatus, S.S_Name, 
                    ISNULL(p.Phm_fname, ' ') + ' ' + ISNULL(p.Phm_lname, ' ') AS 'PhmName', ISNULL(S.PHM_CITY, ' ') + ' ' + ISNULL(S.PHM_STATE, ' ') AS 'Phm_city'
  FROM         Web_Ship AS w INNER JOIN
                    Phm_of_rcrd AS p ON p.phm_num = w.phm_num INNER JOIN
                    Stdy_Site AS S ON w.s_num = S.S_Num
  WHERE     (w.status = @status)
  ORDER BY w.order_id DESC"
              &lt;SelectParameters&gt;
                       &lt;asp:ControlParameter ControlID="StatusDropDownList" Name="Status" 
              PropertyName="Text" Type="Char" /&gt;
              &lt;/SelectParameters&gt;
      &lt;/asp:SqlDataSource&gt;
  </code></pre>