本帖最后由 ap626 于 2009-11-26 23:22:03 编辑

解决方案 »

  1.   

    select * from [data] where 何村='"+ comboBox3.Text+"' and (周岁>13 or 周岁<17) and len(isnull(年级,'')>1 order by 编号" ,mycon);
      

  2.   

    select * from [data] where 何村='"+ comboBox3.Text+"' and (周岁>13 and 周岁 <17) and len(isnull(年级,'')>1 order by 编号" ,mycon);
      

  3.   

    语法错误 (操作符丢失) 在查询表达式 '何村='长安' and (周岁>13 or周岁<17) and (isnull(年级,'')>1 order by 编号' 中。
      

  4.   

    用于函数参数的个数不对 在查询表达式 '何村='长安' and (周岁>13 or 周岁<17) and  len(isnull(年级,''))>1' 中再请楼上的看看
      

  5.   

      OleDbDataAdapter adpter = new OleDbDataAdapter("select * from [data] where 何村='" + comboBox3.Text + "' and (周岁>13 or 周岁<17) and len(isnull(年级,''))>1 order by 编号", mycon);不好意思,麻烦你
      

  6.   


    declare @test table(何村 varchar(50),周岁 int,年级 int,编号 int)insert into @test
    select '波导',16,20,1 union all
    select '波导',16,2,2select * from @test where 何村='波导' and (周岁>13 or 周岁 <17) and isnull(年级,0)>10 order by 编号
    不好意思,没认真注意到你的年级是数值,数值的话应该是isnull(年级,0)>10
      

  7.   

    OleDbDataAdapter adpter = new OleDbDataAdapter("select * from [data] where 何村='" +
                   comboBox3.Text + "' and (周岁>13 or 周岁<17) and isnull(年级,0)>10  order by 编号", mycon);
    这样写吧,但是不对呢?
      

  8.   

    用于函数参数的个数不对 在查询表达式 '何村='长安' and (周岁>13 or 周岁<17) and isnull(年级,0)>10' 中。这是错误信息
      

  9.   

    靠,你是Access数据库吧,isnull(年级,0)>10 直接换成 年级>10吧,Access的isnull和MSSQL的不一样
      

  10.   

    哦,Access的isnull和MSSQL的不一样原来是这个原因哦,谢谢了哦