判断语句里是否有数据:
strSql1="select top 10 * from t_message where begdate < = getdate() and enddate >=getdate() order by begdate";
rsVector1 = CCommonDAO.select(strSql1,"ESYSDATACON");
if(rsVector1!=null&&!rsVector1.isEmpty()){
title=new String[rsVector1.size()];
billman=new String[rsVector1.size()];
enddate=new String[rsVector1.size()];
begdate=new String[rsVector1.size()];
bill=new String[rsVector1.size()];
for(int j=0;j<rsVector1.size();j++){
CM1 = (CommonModel)rsVector1.get(j);
title[j]=CM1.getAttrValue("title");
billman[j]=CM1.getAttrValue("billman");
enddate[j]=CM1.getAttrValue("enddate");
begdate[j]=CM1.getAttrValue("begdate");
bill[j]=CM1.getAttrValue("bill");
}
}
计算一个月的最后一天
如算八月的最后一天,那么直接用九月一日减一,再取日期,一切OK.