Jump to content
honkmaster

CURDATE() not working for next month

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...