title: MYSQL select oldest record nearest to given date but not older
body: <p>I have a table with records belonging to different users. </p>
  
  <p>Table:</p>
  
  <pre><code>RECORD_ID     USER_ID     DATE_CREATED
  1             5           08/05/12
  2             5           08/04/12
  3             10          08/05/12
  4             10          08/02/12
  5             10          08/01/12
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>SELECT user_id, MIN(date_created) as date_created
  FROM (entries) 
  GROUP BY user_id
  </code></pre>
  
  <p>The query returns the oldest record for each users.</p>
  
  <pre><code>RECORD_ID     USER_ID     DATE_CREATED
  2             5           08/04/12
  5             10          08/01/12
  </code></pre>
  
  <p>How can I select the oldest record nearest to a given date but not older?  Something along the lines of...</p>
  
  <pre><code>SELECT oldest record &gt; given oldest record
  WHERE oldest record NOT =&lt; given oldest record
  </code></pre>
  
  <p>For example a query returns all records for user <code>10</code>:</p>
  
  <pre><code>RECORD_ID     USER_ID     DATE_CREATED
  3             10          08/05/12
  4             10          08/02/12
  5             10          08/01/12
  </code></pre>
  
  <p>The given date for user <code>10</code> is <code>08/02/12</code>. Now I have to select the next oldest record above <code>08/02/12</code>. </p>
  
  <p>That would be <code>08/05/12</code> and never records below that unless it reached the top. How is this possible in MYSQL?</p>