I want to add 2 months and 2 years to the current date but for some reason i cannot get it to work.
Select DATE_ADD(NOW(), INTERVAL 2 MONTH, INTERVAL 2 YEAR);
You could also just use addition
SELECT NOW() + INTERVAL 2 YEAR + INTERVAL 2 MONTH
Try using date_add()
twice:
Select DATE_ADD(DATE_ADD(NOW(), INTERVAL 2 MONTH), INTERVAL 2 YEAR);
Or once:
Select DATE_ADD(NOW(), INTERVAL 14 MONTH);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With