Jump to content

finding spec date


yoko

Recommended Posts

I am guessing that the end dates shown in the example (the first day of the next month) are not inclusive? If so, the following should work (untested and is probably not the only or quickest way) -

 

SELECT your_columns FROM your_table WHERE
PERIOD_ADD(REPLACE(LEFT(CURDATE(),7),'-',''),-1) = REPLACE(LEFT(your_date_column,7),'-','')

 

The period_add function takes care of year/month roll-over/roll-under.

Link to comment
https://forums.phpfreaks.com/topic/103238-finding-spec-date/#findComment-528930
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.