数据库是Mysql吗?试试
String aaa="select * from guanyuanbiao,zhiwu where guanyuanbiao.zhiwei=zhiwu.IDzhiwu and birthday like '%10-8' order by guanyuanbiao.IDshiguan asc,guanyuanbiao.zhiwei asc";

解决方案 »

  1.   

    我的数据库是sql server2000的,还是不行,出现无效的光标状态。我是查找今天和5天之内的生日的人员,我的程序如下:
    <%
    int montha;
    int datea;
    int dateb;
    Date now=new Date();
    montha=(now.getMonth()+1);
    datea=(now.getDate());   //今天的日期
    dateb=(now.getDate()+5);
    String dd=montha+"-"+datea;
    String ee=montha+"-"+dateb;
    ResultSet rs=stmt.executeQuery("select * from guanyuanbiao,zhiwu where guanyuanbiao.zhiwei=zhiwu.IDzhiwu and birthday between '"+dd+"' and '"+ee+"' order by guanyuanbiao.IDshiguan asc,guanyuanbiao.zhiwei asc");
      

  2.   

    我的程序这样写就可以了。
    ResultSet rs=stmt.executeQuery("select * from guanyuanbiao,zhiwu where guanyuanbiao.zhiwei=zhiwu.IDzhiwu and birthday between '1953-'+'"+dd+"' and '1953-'+'"+ee+"' order by guanyuanbiao.IDshiguan asc,guanyuanbiao.zhiwei asc");加上'1953-'符合日期型格式的就可以了,请问日期型格式的能不能改成10-8这样的,去掉前面的年份也可以的。
      

  3.   

    select * from to_char(birthday,'MM-DD')='10-08'这是ORACLE的写法,找找SQL SERVER 中类似的函数