title: Select max date and the date before
body: <p>I have a data table which is updated every day except Saturday and Sunday.
  The problem lies in so that when I retrieve data with max (date) and max (date) -1</p>
  
  <p>But it fails when I try to retrieve data for today (Monday) and yesterday (Sunday) when max (date) -1 does not exist.</p>
  
  <p>the data can be updated on Saturday and Sunday, but since it's exchange rate I update.
  Will it give the same exchange rates Friday, Saturday and Sunday.</p>
  
  <p>This is one way to solve the problem this way, but there is a better</p>
  
  <pre><code>string weekend = DateTime.Now.DayOfWeek.ToString();
  if (weekend == "Monday")
  {
  select ***** where max(date)-3 from *****
  }
  </code></pre>