get data of current month and year in mysql code example Example: mysql select month and year SELECT DATE_FORMAT(test_date,'%Y%m') AS date FROM test_table;