SQL SELECT 3 MONTHS +/-


/ Published in: SQL
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.