title: Using a SQL WHERE clause on Max value of Multiple Columns
body: <p>I found a great solution to return the max value of multiple columns (<a href="https://stackoverflow.com/questions/71022/sql-max-of-multiple-columns/6871572#6871572?newreg=d1235207d8614fa2b3eb9551f1df1cf9">SQL MAX of multiple columns?</a>).  See below.  It works great for my application, but I have no idea how to run a WHERE on the [MaxDate] value.  I can't seem to figure our the column name.</p>
  
  <pre><code>SELECT [Other Fields],
      (SELECT Max(v) 
       FROM (VALUES (date1), (date2), (date3),...) AS value(v)) as [MaxDate]
  FROM [YourTableName]
  WHERE [MaxDate] = '2016-01-01'  &lt;---I know this is wrong but need help
  </code></pre>