Posted By

jafar on 08/13/11


Tagged

sql date


Versions (?)

SQL SELECT 3 MONTHS +/-


 / Published in: SQL
 

Select rows that are 3 months ahead or 3 months behind from the current date.

  1. 'SELECT * FROM events WHERE date > DATE_SUB(NOW(), INTERVAL 3 MONTH) AND date < DATE_ADD(NOW(), INTERVAL 3 MONTH) ORDER BY date DESC'

Report this snippet  

You need to login to post a comment.