removedate是日期型数据 thedate和thedate2是保存用户输入的的时间 我想查询某段时间的字段
sql=sql"and removedate>'"&thedate&"' and removedate<'"&thedate2&"'" 请问为什么出错~~“类型不匹配” 应该这样写 我把数据库改成日期型还是不 行
lb=trim(request("lb")) bm=trim(request("bm")) str=replace(trim(request("str")),"'","''")'str和tiaojian这两个是查询时返回的 tiaojian=trim(request("tiaojian")) date1=trim(request("thedate")) date2=trim(request("thedate2")) if date1<>"" and date2<>"" then if cdate(date1)>cdate(date2) then thedate=date2 thedate2=date1 else thedate=date1 thedate2=date2 end if end if sql="select diaodong.*,zl_yuangong.bh as bh2,zl_yuangong.yg_name as yg_name2,zl_yuangong.id as id2,zl_yuangong.yg_sex as sex2,zl_yuangong.islizhi as islizhi2 from diaodong , zl_yuangong where diaodong.bh=zl_yuangong.bh " if lb<>"" then '所有类别人员,离职,在职,试用人员的调动情况 sql=sql & " and zl_yuangong.islizhi='"&lb&"'" end if if bm<>"" then '各个部门的调动情况 sql=sql & " and (newbm='"&bm&"' or oldbm='"&bm&"')" '点击左边部门进行查询 end if if trim(request("s"))<>"" then '根据条件进行查询 sql=sql & " and removedate>'"&thedate&"' and removedate<'"&thedate2&"'" if str<>"" then sql=sql & " and diaodong."&tiaojian&" like '%"&str&"%'" end if end if rs.open sql,conn,1,1 if rs.eof then response.write "<table><tr><td><br></br><center>暂无数据,请添加! "&sql&"</center><br></br></td></tr></table>" response.end end if if not rs.eof then 这是整段代码~~