title: compare between two dates
body: <p>i have a course table and a course  due dates table like this </p>
  
  <pre><code>course_id | course_name 
  1           A
  2           B 
  
  due_id | start_date | end_date    course_id 
  1        2011-02-01   2011-02-28  1
  2        2011-03-01   2011-03-15  1
  </code></pre>
  
  <p>now what i am trying to do from last tow day that write a query or code that will show a course name with current date session.for example if current date is betwen start and end date course should come like this and if its in next date session it should come with next due_id </p>
  
  <pre><code>course_id | course_name | due_id
  1           A           | 1
  </code></pre>
  
  <p>if this database structure is wrong for this please let me know </p>
  
  <p>thanks for help</p>