Jump to content

CURDATE() not working for next month


honkmaster

Recommended Posts

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

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...