title: mysql query to check greater than date and time
body: <p>I have two date and time columns in my database. I want to get rows where date is greater than or equal to current date and current time</p>
  
  <p>I have used below query to get result</p>
  
  <pre><code>SELECT DISTINCT     
  A.appt_fromUser,A.date,A.time,A.appt_styleType,B.*,A.appt_shoutID,A.shout_status 
  from appoint_db A 
  INNER JOIN checkedin_db B ON A.appt_id=B.appid 
  where A.appt_toUser='$userid' 
  and A.date&gt;='$date' 
  and InChair='0' 
  and A.time&gt;='$time'
  </code></pre>
  
  <p>However this isn't working as I'd hoped. </p>
  
  <p>Eg, if I have two rows:</p>
  
  <p>2012/05/30 Time:6.00<br>
  2012/05/30 Time:13.00   </p>
  
  <p>And I query this with date of 2012/05/02 and Time:12:00, it returns only only the row where the time is greater than 12:00</p>