sql="Select from user where username='";
sql += session.getAttribute("UserName") +"' and to_date(month,??????) >= to_date('"+startDateQuery;
sql += "','yyyymm') and to_date(month,??????) <= to_date('"+endDateQuery+"','yyyymm') ";把数据库中month字段转换成日期型,再进行比较。具体样式你自己写吧。