title: t sql max() in where clause
body: <p>I'm trying to use a <code>MAX(InvoiceDate)</code> in my where clause:</p>
  
  <pre><code>SELECT a.Customer,
         a.Name,
         b.Name,
         a.Branch,
         a.Area,
         MAX(e.InvoiceDate)
  FROM   Customers a
         LEFT JOIN Rep b
           ON a.Salesperson = b.Salesperson
              AND a.Branch = b.Branch
         LEFT JOIN Sales e
           ON e.Customer = a.Customer
  WHERE  max(e.InvoiceDate) &gt;= '2013-11-01'
  GROUP  BY a.Customer,
            a.Name,
            b.Name,
            a.Branch,
            a.Area 
  </code></pre>