Find the next month for given date in mysql
Find the COUNT(next month Between next month +2DAYS) for the created date in table(including Year wise Dec ,Jan like)
How to do this using mysql query Query need for both datatype da开发者_JAVA百科te and datetime
If you only want the MONTH, then use SELECT MONTH('2011-03-28' + INTERVAL 1 MONTH)
Works the same for DATE and DATETIME (replace the actual date I quoted with your own SQL and column name). For more info you can refer to http://dev.mysql.com/doc/refman/5.1/en/datetime.html
SELECT COUNT(whatever)
FROM
yourTable
WHERE
yourDateColumn BETWEEN NOW()+INTERVAL 1 MONTH AND NOW()+INTERVAL 1 MONTH + INTERVAL 2 DAYS
精彩评论