honkmaster Posted April 28, 2018 Share Posted April 28, 2018 Hi I have a query that returns the count of entries based on CURDATE(), it works for any dat in this month (April) but does not work for next month (May). I think it is something to do with CURDATE()+3 returns 2018-04-31 which should be 2018-05-01 This Works as Date is in April SELECT COUNT(Machine) FROM production WHERE Status = 'Confirmed' AND DATE(FROM_UNIXTIME(production.Required)) = CURDATE() This does not work as in May SELECT COUNT(Machine) FROM production WHERE Status = 'Confirmed' AND DATE(FROM_UNIXTIME(production.Required)) = CURDATE()+3 Link to comment Share on other sites More sharing options...
dsonesuk Posted April 28, 2018 Share Posted April 28, 2018 (edited) Try with CURDATE() + INTERVAL 3 DAY OR DATE_ADD(CURDATE(),INTERVAL 3 DAY) Edited April 28, 2018 by dsonesuk Link to comment Share on other sites More sharing options...
Sherin Posted January 29, 2020 Share Posted January 29, 2020 (edited) DATE_ADD(CURDATE(),INTERVAL 1 MONTH) OR CURDATE()+INTERVAL 1 MONTH Edited January 29, 2020 by Sherin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now