title: Mysql where query... select * where field1 +field2 + field3 <= field 4
body: <p>Basically I want to add up the numbers stored in <code>field1</code>, <code>field2</code> and <code>field3</code> and only display records that this total is less than <code>field4</code>...</p>
  
  <p>For example: <code>select * from table where field1 + field2 + field3 &lt;= field 4</code></p>
  
  <p>But that doesnt work....any help appreciated</p>
  
  <p>here is my actual SQL as you can see its more complex:</p>
  
  <pre><code>SELECT
    *,
    SUM ( amountpaid , amountpaid2 , amountpaid3 ) AS total AND
    DATE_FORMAT(date_start, ' %d.%m.%Y') AS date_formatted
  FROM 
    calendar_event 
  WHERE 
    Date_start BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 14 DAY) AND 
    total &lt;= amount )
  </code></pre>
  
  <p>Rob</p>