| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2763 人关注过本帖
标题:标准表达式中数据类型不匹配
只看楼主 加入收藏
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:8 
标准表达式中数据类型不匹配
页面显示正常,但是选择大类出错:
Microsoft JET Database Engine 错误 '80040e07'
标准表达式中数据类型不匹配。
/1/count/count_sell.asp,行 190
===============================================源代码如下:
程序代码:
<%if request.Cookies("shiwei_username")="" then%>
<script language="javascript">top.location.href="../index.asp"</script>
<% 
  response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->

<html>
<head>
<title><%=gongsi%>-收费统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>body {background-color:#FFFFFF;}</style>
<script language="javascript">
function collapse(img, objName)
{
    var obj;
    obj = document.getElementById(objName);
    if (img.src.indexOf('open') != -1)
    {
    img.src = img.src.replace('open', 'close');
    obj.style.display = 'none';
    }
    else
    {
    img.src = img.src.replace('close', 'open');
    obj.style.display = '';
    }
}
function collapseall(img)
{
    var obj;
    if (img.src.indexOf('open') != -1)
    {
    img.src = img.src.replace('open', 'close');
    for (x=1;x<=<%=maxrecord%>;x++)
    {
    obj = document.getElementById("buy"+x);
    if (obj)
    {obj.style.display = 'none';}}
    }
    else
    {
    img.src = img.src.replace('close', 'open');
    for (x=1;x<=<%=maxrecord%>;x++)
    {
    obj = document.getElementById("buy"+x);
    if (obj)
    {obj.style.display = '';}
    }}
}
</script>

<script language=javascript>
function preview() {
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprint-->";
eprnstr="<!--endprint-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
window.document.body.innerHTML=prnhtml;
window.print();
window.document.body.innerHTML=bdhtml;
}
</script>
</HEAD>

<BODY>
<script>
function CheckAll(form) {
  for (var i=0;i<form.elements.length;i++) {
    var e = form.elements[i];
    if (e.name != 'chkall')  e.checked = form.chkall.checked;
  }
}
</script>
<%if fla74="0" and request.Cookies("shiwei_id")<>"1" then%>
<br><center><img src="../images/note.gif" align="absmiddle">&nbsp;<font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<% 
  response.end
end if

'取得当前页码
currentpage=request("page")
'response.write currentpage
'response.end
if currentpage<1 or currentpage="" then
  currentpage="1"
end if

'取得搜索关键字 
nowstartdate=request("startdate")
if nowstartdate="" then
  nowstartdate=date()-day(date()-1)
end if
nowenddate=request("enddate")
if nowenddate="" then
  nowenddate=date()
end if
nowxiaoqu=request("xiaoqu")
nowbigclass=request("bigclass")
nowsmallclass=request("smallclass")
if nowbigclass="" then nowsmallclass=""
nowkeyword=request("keyword") 

    if request.Cookies("shiwei_id")="1" or fla88="1" then
      sql="select * from xiaoqu order by id"
      set rs_xiaoqu=conn.execute(sql)
    else
      sql="select * from xiaoqu where instr(fuzeren,',"&request.Cookies("shiwei_id")&",')>0 order by id"
      set rs_xiaoqu=conn.execute(sql)
      if rs_xiaoqu.eof then
        nowxiaoqu="0"
      elseif request("xiaoqu")="" then
        nowxiaoqu=rs_xiaoqu("id")
      end if     
    end if

  sql="select * from sell where type=0 and louyu and isok"
  if request.Cookies("shiwei_id")<>1 and lookbuysell="yes" and fla89="0" then
    sql=sql&" and id_login="&request.Cookies("shiwei_id")
  end if
  if nowstartdate<>"" then
    sql=sql&" and selldate-#"&nowstartdate&"#>=0"
  end if 
  if nowenddate<>"" then
    sql=sql&" and selldate-#"&nowenddate&"#<=0"
  end if

  if nowxiaoqu<>"" then
    sql=sql&" and bianhao in (select bianhao from sell where type=0 and xiaoqu1="&nowxiaoqu&" and louyu=false)"
  end if
  if nowbigclass<>"" then
    sql=sql&" and bigclass="&nowbigclass
  end if
  if nowsmallclass<>"" then
    sql=sql&" and smallclass="&nowsmallclass
  end if
  if nowkeyword<>"" then
    sql=sql&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or bianhao in (select bianhao from sell where type=0 and (title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')))"
  end if

  if request("order1")<>"" then
    sql=sql&" order by bianhao "&request("order1")
  elseif request("order2")<>"" then
    sql=sql&" order by title1 "&request("order2")
  elseif request("order3")<>"" then
    sql=sql&" order by selldate "&request("order3")
  elseif request("order4")<>"" then
    sql=sql&" order by id_login "&request("order4")
  elseif request("order5")<>"" then
    sql=sql&" order by shuliang "&request("order5")
  elseif request("order6")<>"" then
    sql=sql&" order by price1 "&request("order6")
  elseif request("order7")<>"" then
    sql=sql&" order by price2 "&request("order7")
  elseif request("order8")<>"" then
    sql=sql&" order by (price1-price2) "&request("order8")
  elseif request("order9")<>"" then
    sql=sql&" order by yezhu "&request("order9")
  elseif request("order10")<>"" then
    sql=sql&" order by yezhu "&request("order10")               
  else
    sql=sql&" order by selldate desc" 
  end if
 
  sql2="select * from buy where type=1 and louyu and isok"
  if nowstartdate<>"" then
    sql2=sql2&" and selldate-#"&nowstartdate&"#>=0"
  end if 
  if nowenddate<>"" then
    sql2=sql2&" and selldate-#"&nowenddate&"#<=0"
  end if
  if nowxiaoqu<>"" then
    sql2=sql2&" and bianhao in (select bianhao from buy where type=1 and xiaoqu1="&nowxiaoqu&" and louyu=false)"
  end if
  if nowbigclass<>"" then
    sql2=sql2&" and bigclass="&nowbigclass
  end if
  if nowsmallclass<>"" then
    sql2=sql2&" and smallclass="&nowsmallclass
  end if
  if nowkeyword<>"" then
    sql2=sql2&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or bianhao in (select bianhao from buy where type=1 and (title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')))"
  end if  

set count_sell = server.createobject("ADODB.RecordSet")   
count_sell.open sql,conn,1,3
nowmoney=0
nowprice1=0
zongshuliang=0
do while count_sell.eof=false
      sql3="select sum(price1*shuliang),sum(price2*shuliang),sum(shuliang) from sell where type=0 and bianhao='"&count_sell("bianhao")&"' and louyu=false"
      if nowxiaoqu<>"" then
        sql3=sql3&" and xiaoqu1="&nowxiaoqu
      end if
      if nowkeyword<>"" then
        sql3=sql3&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')"
        end if
      set rs_sum=conn.execute(sql3)
  nowmoney=nowmoney+rs_sum(0)
  nowprice1=nowprice1+rs_sum(1)
  zongshuliang=zongshuliang+rs_sum(2)   
  count_sell.movenext
loop
set count_back = server.createobject("ADODB.RecordSet")   
count_back.open sql2,conn,1,3
nowmoney2=0
nowprice2=0
zongshuliang2=0
do while count_back.eof=false
      sql3="select sum(price1*shuliang),sum(price2*shuliang),sum(shuliang) from buy where type=1 and bianhao='"&count_back("bianhao")&"' and louyu=false"
      if nowxiaoqu<>"" then
        sql3=sql3&" and xiaoqu1="&nowxiaoqu
      end if
      if nowkeyword<>"" then
        sql3=sql3&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')"
        end if
      set rs_sum=conn.execute(sql3)
  nowmoney2=nowmoney2+rs_sum(0)
  nowprice2=nowprice2+rs_sum(1)
  zongshuliang2=zongshuliang2+rs_sum(2)       
  count_back.movenext
loop
%>
<table width="100%" border="0" cellpadding="0" cellspacing="2" align="center">
  <form name="form2">
    <tr><td width="5%" height="21">&nbsp;<img src="../images/print.jpg" align="absmiddle" style="cursor:hand;" onClick="preview();window.close()"></td>
  <td width="95%" align="right">开始日期:<input name="startdate" value="<%=nowstartdate%>" readonly style="width:80px">
<img src="../images/date.gif" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:window.open('day.asp?form=form2&field=startdate&oldDate='+startdate.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=170,top=150,left=590');">结束日期:<input name="enddate" value="<%=nowenddate%>" readonly style="width:80px"><img src="../images/date.gif" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:window.open('day.asp?form=form2&field=enddate&oldDate='+enddate.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=170,top=150,left=740');">
<select name="xiaoqu" onChange="form2.submit()">
 <%if request.Cookies("shiwei_id")="1" or fla88="1" then%>
  <option value="">所有小区</option>
   <%elseif rs_xiaoqu.eof then%>
    <option value="0">没有你管理的小区</option><%end if%>
     <%do while rs_xiaoqu.eof=false%>
      <option value="<%=rs_xiaoqu("id")%>"<%if trim(cstr(rs_xiaoqu("id")))=nowxiaoqu then%> selected="selected"<%end if%>><%=rs_xiaoqu("xiaoqu")%></option>
       <%
        rs_xiaoqu.movenext
        loop
       %>
       </select>
       <%
    sql="select * from bigclass order by id"
    set rs_bigclass=conn.execute(sql)
    %>
    <select name="bigclass" onChange="form2.submit()">
        <option value="">所有大类</option>
        <%do while rs_bigclass.eof=false%>
        <option value="<%=rs_bigclass("id")%>"<%if trim(cstr(rs_bigclass("id")))=nowbigclass then%> selected="selected"<%end if%>><%=rs_bigclass("bigclass")%></option>
        <%
      rs_bigclass.movenext
    loop
    %>
        </select>
        <%
    if nowbigclass="" then
      nowbigclass2=0
    else
      nowbigclass2=nowbigclass
    end if
    sql="select * from smallclass where id_bigclass="&nowbigclass2&" order by id"
    set rs_smallclass=conn.execute(sql)
    %>
    <select name="smallclass" onChange="form2.submit()">
        <option value="">所有小类</option>
        <%do while rs_smallclass.eof=false%>
        <option value="<%=rs_smallclass("id")%>"<%if trim(cstr(rs_smallclass("id")))=nowsmallclass then%> selected="selected"<%end if%>><%=rs_smallclass("smallclass")%></option>
        <%
      rs_smallclass.movenext
    loop
    %>
      </select>     
     <input type="text" name="keyword" size="15" value="<%=nowkeyword%>"><input type="hidden" name="hid" value="ok">&nbsp;<input type="submit" value="查询" class="button">&nbsp;</td>
</tr></form></table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
    <tr><td><img src="../images/r_1.gif" alt="" /></td>
     <td width="100%" background="../images/r_0.gif">
    <table cellpadding="0" cellspacing="0" width="100%">
  <tr><td>&nbsp;收费统计<a href="../excle.asp"><img src="../images/excel.jpg" border="0" align="absmiddle" alt="导出Excel表格"></a></td>
<td align="right">收费总额<i><%=formatnumber(nowmoney,2,-1)%></i>元(<%=formatnumber(zongshuliang,0,-1)%>),业主退单:<u><%=formatnumber(nowmoney2,2,-1)%></u>元 (<%=formatnumber(zongshuliang2,0,-1)%>),实际收费:<b><%=formatnumber(nowmoney-nowmoney2,2,-1)%></b>元<%if request.Cookies("shiwei_id")="1" or fla87="1" then%>,利润:<b><%=formatnumber(nowmoney-nowprice1-nowmoney2+nowprice2,2,-1)%></b>元<%end if%>&nbsp;</td>
</tr></table></td>
  <td><img src="../images/r_2.gif" alt="" /></td>
    </tr>
      <tr><td></td>
    <td>
  <!--startprint-->
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
 <form name="form1">
  <input type="hidden" name="startdate" value="<%=nowstartdate%>">
  <input type="hidden" name="enddate" value="<%=nowenddate%>">
  <input type="hidden" name="xiaoqu" value="<%=nowxiaoqu%>">
  <input type="hidden" name="bigclass" value="<%=nowbigclass%>">
  <input type="hidden" name="smallclass" value="<%=nowsmallclass%>">
  <input type="hidden" name="keyword" value="<%=nowkeyword%>">
  <input type="hidden" name="order1" value="<%=request("order1")%>">
  <input type="hidden" name="order2" value="<%=request("order2")%>">
  <input type="hidden" name="order3" value="<%=request("order3")%>">
  <input type="hidden" name="order4" value="<%=request("order4")%>">
  <input type="hidden" name="order5" value="<%=request("order5")%>">
  <input type="hidden" name="order6" value="<%=request("order6")%>">
  <input type="hidden" name="order7" value="<%=request("order7")%>">
  <input type="hidden" name="order8" value="<%=request("order8")%>">
  <input type="hidden" name="order9" value="<%=request("order9")%>">
  <input type="hidden" name="order10" value="<%=request("order10")%>">
  <input type="hidden" name="order11" value="<%=request("order11")%>">
  <input type="hidden" name="order12" value="<%=request("order12")%>">
  <input type="hidden" name="order13" value="<%=request("order13")%>">
  <input type="hidden" name="order14" value="<%=request("order14")%>">
  <input type="hidden" name="order15" value="<%=request("order15")%>">
  <tr align="center">
   <td class="category" width="10"><img src="../images/folder_close.gif" style="cursor:hand" onClick="collapseall(this)" /></td>
    <td class="category" height="30"><a href="?order1=<%if request("order1")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">编号<%if request("order1")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
    <td class="category"><a href="?order2=<%if request("order2")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">项目名称<%if request("order2")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
    <td class="category"><a href="?order3=<%if request("order3")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">缴费时间<%if request("order3")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
    <td class="category"><a href="?order4=<%if request("order4")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">经办人<%if request("order4")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
    <td class="category"><a href="?order5=<%if request("order5")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">数量<%if request("order5")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
    <td class="category"><a href="?order6=<%if request("order6")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">缴费金额<%if request("order6")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
    <%if request.Cookies("shiwei_id")="1" or fla87="1" then%>
    <td class="category"><a href="?order7=<%if request("order7")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">成本金额<%if request("order7")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
    <td class="category"><a href="?order8=<%if request("order8")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">利润<%if request("order8")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
    <%end if%>
    <td class="category"><a href="?order9=<%if request("order9")="asc" then%>desc<%else%>asc<%end if%>&page=<%=currentpage%>&startdate=<%=nowstartdate%>&enddate=<%=nowenddate%>&xiaoqu=<%=nowxiaoqu%>&bigclass=<%=nowbigclass%>&smallclass=<%=nowsmallclass%>&keyword=<%=nowkeyword%>" class="title">业主<%if request("order9")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a></td>
  </tr>
  <%
  set rs_buy =server.createobject("ADODB.RecordSet")   
  rs_buy.open sql,conn,1,3
  if not rs_buy.eof then
  rs_buy.pagesize=maxrecord
  rs_buy.absolutepage=currentpage
  for currentrec=1 to rs_buy.pagesize
    if rs_buy.eof then
      exit for
    end if
  %>
  <tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''" onDblClick="javascript:var win=window.open('../produit/print_sell.asp?bianhao=<%=rs_buy("bianhao")%>','详细信息','width=853,height=470,top=176,left=161,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes'); win.focus()">
<td align="center"><img src="../images/folder_close.gif" style="cursor:hand" onClick="collapse(this, 'buy<%=currentrec%>')" /></td>
   <td align="center" height="25"><%=rs_buy("bianhao")%></td>
      <td align="center">
        <%
    sql="select * from produit where id="&rs_buy("title1")
    set rs_produit=conn.execute(sql)
    %>
    <%if rs_produit.eof then%><%=rs_buy("title")%><%else%><%=rs_produit("title")%><%end if%></td>
    <td align="center"><%=rs_buy("selldate")%></td>
    <td align="center">
    <%
    sql="select * from login where id="&rs_buy("id_login")
    set rs_login=conn.execute(sql)
    %>
    <%if rs_login.eof then%><%=rs_buy("login")%><%else%><%=rs_login("username")%> (<%=rs_login("gonghao")%>)<%end if%></td>
    <td align="center">
    <%
    sql="select sum(shuliang) from sell where bianhao='"&rs_buy("bianhao")&"' and louyu=false"
    if nowxiaoqu<>"" then
    sql=sql&" and xiaoqu1="&nowxiaoqu
    end if
    if nowkeyword<>"" then
        sql=sql&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')"
      end if
    set rs_sum=conn.execute(sql)
    %>
    <%=formatnumber(rs_sum(0),0,-1)%></td>
    <td align="center">
    <%
    sql="select sum(price1*shuliang) from sell where bianhao='"&rs_buy("bianhao")&"' and louyu=false"
    if nowxiaoqu<>"" then
    sql=sql&" and xiaoqu1="&nowxiaoqu
    end if
    if nowkeyword<>"" then
        sql=sql&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')"
      end if
    set rs_sum=conn.execute(sql)
    %>
    <%=formatnumber(rs_sum(0),2,-1)%></td>
    <%if request.Cookies("shiwei_id")="1" or fla87="1" then%>
    <td align="center">
    <%
    sql="select sum(price2*shuliang) from sell where bianhao='"&rs_buy("bianhao")&"' and louyu=false"
    if nowxiaoqu<>"" then
    sql=sql&" and xiaoqu1="&nowxiaoqu
    end if
    if nowkeyword<>"" then
        sql=sql&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')"
      end if
    set rs_sum=conn.execute(sql)
    %>
    <%=formatnumber(rs_sum(0),2,-1)%></td>
    <td align="center">
    <%
    sql="select sum((price1-price2)*shuliang) from sell where bianhao='"&rs_buy("bianhao")&"' and louyu=false"
    if nowxiaoqu<>"" then
    sql=sql&" and xiaoqu1="&nowxiaoqu
    end if
    if nowkeyword<>"" then
        sql=sql&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')"
      end if
    set rs_sum=conn.execute(sql)
    %>
    <%=formatnumber(rs_sum(0),2,-1)%></td><%end if%>
    <td align="center">
    <%
    sql="select * from yezhu where id="&rs_buy("yezhu")
    set rs_yezhu=conn.execute(sql)
    %>
        <%if rs_yezhu.eof=false then%><%=rs_yezhu("username")%><%else%>非会员<%end if%></td>
        </tr>
        <%
        sql="select * from sell where type=0 and louyu=false and bianhao='"&rs_buy("bianhao")&"'"
    if nowxiaoqu<>"" then
    sql=sql&" and xiaoqu1="&nowxiaoqu
    end if
    if nowkeyword<>"" then
        sql=sql&" and (bianhao = '"&nowkeyword&"' or yezhu in (select id from yezhu where username like '%"&nowkeyword&"%') or id_login in (select id from login where username like '%"&nowkeyword&"%') or title like '%"&nowkeyword&"%' or daihao like '%"&nowkeyword&"%')"
      end if
    set rs_buy2=conn.execute(sql)
        %>
        <tr id="buy<%=currentrec%>" style="display:none;">
        <td colspan="16" class="category">
        <table align="center" cellpadding="4" cellspacing="1" class="grid" border="1" width="100%">
    <tr align="center"><%if showpic="yes" then%><td width="70">图片</td><%end if%>
    <td height="30">项目代号</td>
    <td>项目名称</td>
    <td>所属小区</td>
    <td>数量</td>
    <td>单价</td>
    <td>金额</td>
    <%if request.Cookies("shiwei_id")="1" or fla87="1" then%>
    <td>成本单价</td>
    <td>成本金额</td>
    <%end if%></tr>     
    <%
    do while rs_buy2.eof=false
    sql="select * from produit where id="&rs_buy2("title1")
    set rs_produit=conn.execute(sql)       
    %>
    <tr><%if showpic="yes" then%><td align="center"><%if rs_produit.eof then%><%if rs_buy2("photo")<>"" then%><a href="../upload/<%=rs_buy2("photo")%>" target="_blank"><img src="../upload/<%=rs_buy2("photo")%>" border="0" width="60"></a><%else%>无图<%end if%><%else%><%if rs_produit("photo")<>"" then%><a href="../upload/<%=rs_produit("photo")%>" target="_blank"><img src="../upload/<%=rs_produit("photo")%>" border="0" width="60"></a><%else%>无图<%end if%><%end if%></td><%end if%>
    <td align="center"><%if rs_produit.eof then%><%=rs_buy2("daihao")%><%else%><%=rs_produit("daihao")%><%end if%></td>
    <td align="center"><%if rs_produit.eof then%><%=rs_buy2("title")%><%else%><%=rs_produit("title")%><%end if%></td>
    <td align="center"><%=rs_buy2("xiaoqu")%></td>
    <td align="center"><%=formatnumber(rs_buy2("shuliang"),0,-1)%></td>
    <td align="center"><%=formatnumber(rs_buy2("price1"),2,-1)%></td>
    <td align="center"><%=formatnumber(rs_buy2("shuliang")*rs_buy2("price1"),2,-1)%></td>
    <%if request.Cookies("shiwei_id")="1" or fla87="1" then%>
    <td align="center"><%=formatnumber(rs_buy2("price2"),2,-1)%></td>
    <td align="center"><%=formatnumber(rs_buy2("shuliang")*rs_buy2("price2"),2,-1)%></td>   
    <%end if%> 
    </tr>
    <%
    rs_buy2.movenext
    loop
    %>
    </table>
    备注:<%=replace(rs_buy("beizhu")&"",chr(13),"<br>")%>
      </td>
    </tr>
  <%   
  rs_buy.movenext
  next
  else
  %>
  <tr align="center" onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
  <td colspan="16" height="25" align="center" style="color:red"><b>没有找到记录</b></td>
  </tr><%end if %>

  <%if rs_buy.recordcount>0 then%>
  <tr><td colspan="16" height="30" class="category">
  <table cellpadding=0 cellspacing=0 width="100%">
  <tr><td width="20%" align="left" style="color:#FF0000;">&nbsp;双击查看打印单</td> 
  <td width="80%" align="right">&nbsp;&nbsp;<%=rs_buy.recordcount%>&nbsp;条信息&nbsp;共&nbsp;<%=rs_buy.pagecount%>&nbsp;页&nbsp;
  <%
  nowstart=currentpage-3
  if nowstart<1 then
    nowstart=1
  end if
  nowend=currentpage+3
  if nowend>rs_buy.pagecount then
    nowend=rs_buy.pagecount
  end if
  response.write "&nbsp;<a href='?startdate="&nowstartdate&"&enddate="&nowenddate&"&xiaoqu="&nowxiaoqu&"&bigclass="&nowbigclass&"&smallclass="&nowsmallclass&"&keyword="&nowkeyword&"&page=1&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"&order8="&request("order8")&"&order9="&request("order9")&"&order10="&request("order10")&"&order11="&request("order11")&"&order12="&request("order12")&"&order13="&request("order13")&"&order14="&request("order14")&"&order15="&request("order15")&"' class='page'>最前页</a>&nbsp;"
  for ipage=nowstart to nowend
    if cstr(ipage)=cstr(currentpage) then
      response.write "&nbsp;<span style='font-weight:bold;color:#5858E6'>" & ipage &"</span>&nbsp;"
    else
      response.write "&nbsp;[&nbsp;<a href='?startdate="&nowstartdate&"&enddate="&nowenddate&"&xiaoqu="&nowxiaoqu&"&bigclass="&nowbigclass&"&smallclass="&nowsmallclass&"&keyword="&nowkeyword&"&page="&ipage&"&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"&order8="&request("order8")&"&order9="&request("order9")&"&order10="&request("order10")&"&order11="&request("order11")&"&order12="&request("order12")&"&order13="&request("order13")&"&order14="&request("order14")&"&order15="&request("order15")&"' class='page'>" & ipage &"</a>&nbsp;]&nbsp;"
    end if
  next
  response.write "&nbsp;<a href='?startdate="&nowstartdate&"&enddate="&nowenddate&"&xiaoqu="&nowxiaoqu&"&bigclass="&nowbigclass&"&smallclass="&nowsmallclass&"&keyword="&nowkeyword&"&page="&rs_buy.pagecount&"&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"&order8="&request("order8")&"&order9="&request("order9")&"&order10="&request("order10")&"&order11="&request("order11")&"&order12="&request("order12")&"&order13="&request("order13")&"&order14="&request("order14")&"&order15="&request("order15")&"' class='page'>最后页</a>&nbsp;"
%>
<select name="page" onChange="form1.action='?';form1.submit();">
  <%for x=1 to rs_buy.pagecount%>
    <option value="<%=x%>"<%if currentpage=trim(cstr(x)) then%> selected="selected"<%end if%>><%=x%></option>
      <%next%>
        </select></td>
      </tr></table></td></tr>
    <%end if%>
  </form></table>
<!--endprint-->
</td>
<td></td></tr>
<tr><td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr></table></body></html>

搜索更多相关主题的帖子: 类型 数据 表达 
2010-12-02 10:53
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:4 
在190行前面 加一句Response.Write(sql),后面的代码不要执行,看看sql是什么内容

----我怎能在别人的苦难面前转过脸去----
2010-12-02 12:48
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:4 
好长……190行是哪一行……

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2010-12-02 14:31
jansonwang
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:60
专家分:147
注 册:2010-11-25
收藏
得分:4 
还没结贴啊
2010-12-02 14:41
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
收藏
得分:0 
以下是引用jansonwang在2010-12-2 14:41:00的发言:

还没结贴啊
可以刷页面了,但是不能刷出数据,因为小区是数字型,分类是文本型,有点麻烦

南宁信息网http://www.
2010-12-03 10:46
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:0 
做个转换就可以了

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2010-12-03 11:09
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
收藏
得分:0 
以下是引用hams在2010-12-3 11:09:56的发言:

做个转换就可以了
版主,再具体一点点

南宁信息网http://www.
2010-12-03 11:21
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:4 
你搞个这么长的代码谁有功夫呀!也不把错误行标示出来。

QQ:63572063
2010-12-03 12:29
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:0 
以下是引用天蝎风在2010-12-3 11:21:39的发言:

版主,再具体一点点

可以刷页面了,但是不能刷出数据,因为小区是数字型,分类是文本型,有点麻烦

我说的是这一句,你已经知道类型不一样了,做个转换有什么问题?

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2010-12-03 14:33
快速回复:标准表达式中数据类型不匹配
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038709 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved