select * from table where year*100+month between 201704 and 201803;

じゃだめか?