该语句错在哪?
Microsoft VBScript 编译器错误 错误 '800a0401'
语句未结束
/Shop/Search_Class.asp,行17
Rs.Open "Select * From Products A,BusinessApplication B,BusinessHome C Where C.BusinessHome_Num=A.Product_BusinessHomeNum And DateDiff("d",Format_Time(Cdate(Mid(Product_DataTime,1,(InstrRev(Product_DataTime," ")-1))),2),Format_Time(Cdate(Mid(Now(),1,(InstrRev(Now()," ")-1))),2))=0 And A.Product_BusinessHomeNum=B.Application_BusinessHomeNum",Conn,1,1
------------------------------------------------------------------------------------------------------------------------------------------^
问题点数:0、回复次数:9Top
1 楼chengzhaona(zhaoyin)回复于 2004-08-04 11:01:26 得分 0
再sql server里用查询分析器来执行sql语句试试Top
2 楼kebeixueng(脱变的蚕)回复于 2004-08-04 11:07:29 得分 0
Rs.Open "Select * From Products A,BusinessApplication B,BusinessHome C Where C.BusinessHome_Num=A.Product_BusinessHomeNum And DateDiff("d",Format_Time(Cdate(Mid(Product_DataTime,1,(InstrRev(Product_DataTime," ")-1))),2),Format_Time(Cdate(Mid(Now(),1,(InstrRev(Now()," ")-1))),2))=0 And A.Product_BusinessHomeNum=B.Application_BusinessHomeNum",Conn,1,3
Top
3 楼baby21st(愚人|南京www.njci.net)回复于 2004-08-04 11:09:36 得分 0
str = DateDiff("d",Format_Time(Cdate(Mid(Product_DataTime,1,(InstrRev(Product_DataTime," ")-1))),2),Format_Time(Cdate(Mid(Now(),1,(InstrRev(Now()," ")-1))),2))
resposne.write str & "<br>"'看是否正确
strSql = "Select * From Products A,BusinessApplication B,BusinessHome C Where C.BusinessHome_Num=A.Product_BusinessHomeNum And "&str&" =0 And A.Product_BusinessHomeNum=B.Application_BusinessHomeNum"
response.write strSql '看是否正确
Rs.Open strSql, Conn,1,1
Top
4 楼jervis82(我是海绵.吸.吸.吸...)回复于 2004-08-04 11:10:39 得分 0
太过长的sql语句建议分开来写。这样比较直观点吧。太长我看不懂。没有一点层次感。Top
5 楼sheng9hhd(无形)回复于 2004-08-04 11:13:08 得分 0
Rs.Open "Select * From Products A,BusinessApplication B,BusinessHome C Where C.BusinessHome_Num=A.Product_BusinessHomeNum And DateDiff(""d"",Format_Time(Cdate(Mid(Product_DataTime,1,(InstrRev(Product_DataTime,"" "")-1))),2),Format_Time(Cdate(Mid(Now(),1,(InstrRev(Now(),"" "")-1))),2))=0 And A.Product_BusinessHomeNum=B.Application_BusinessHomeNum",Conn,1,1Top
6 楼sheng9hhd(无形)回复于 2004-08-04 11:13:21 得分 0
"-->""Top
7 楼sunjiujiu(绿茶狂人@抵制日货)回复于 2004-08-04 11:17:03 得分 0
你把这个语句response.write出来,然后到sql的查询分析器中去执行一下看看Top
8 楼littlejc2(半半)回复于 2004-08-04 11:31:50 得分 0
似的,就只有这个办法,另外这个错误以我的经验来看是没有加换行符"_",你试试在换行的时候加这个符号试试Top
9 楼littlejc2(半半)回复于 2004-08-04 11:35:05 得分 0
给你一端调试过的语句看看:
<!--#include file="conn.asp"-->
<html>
<head>
<title>入库数据搜索结果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#C0C0C0">
<%
dim binAddedWhere 'as boolean
strSQL="SELECT * from rkgl"
binAddedWhere=False
if request("tihuoren")<>""Then
if not binAddedWhere then
strSQL=strSQL&" where "
binAddedWhere=true
End if
strSQL=strSQL&" 采购人 LIKE '%"_
& request("tihuoren")_
&"%'"
end if
if Request("thnumber")<>""Then
if not binAddedWhere Then
strSQL=strSQL&" where "
binAddedWhere=true
Else
strSQL=strSQL&" and "
end if
strSQL=strSQL&" 数量 "
if request("thsl")="LT" then
strSQL=strSQL&"<"
Elseif request("thsl")="EQ"then
strSQL=strSQL&"="
else
strSQL=strSQL&">"
end if
strSQL=strSQL&CDBL(Request("thnumber"))
end if
if Request("unitprice")<>""Then
if not binAddedWhere Then
strSQL=strSQL&" where "
binAddedWhere=true
Else
strSQL=strSQL&" and "这个地方不都有换行符吗
end if
strSQL=strSQL&"单价"
if request("dj")="LT" then
strSQL=strSQL&"<"
Elseif request("dj")="EQ"then
strSQL=strSQL&"="
else
strSQL=strSQL&">"
end if
strSQL=strSQL&CDbl(Request("unitprice"))
end if
if request("order")<>""Then
if Not binAddedWhere Then
strSQL=strSQL&" where "
binAddedWhere=true
else
strSQL=strSQL&" and "
End if
strSQL=strSQL&" 入库编号 ="_*********这个地方不都有换行符吗
& request("order")
end if
if request("jingshouren")<>""Then
if Not binAddedWhere Then
strSQL=strSQL&" where "
binAddedWhere=true
else
strSQL=strSQL&" and "
End if
strSQL=strSQL&" 入库经手人 LIKE '%"_
& request("jingshouren")_
&"%'"
end if
strSQL=strSQL&_
" ORDER BY 入库编号"
response.Write(strSQL)
set rs1=conn.execute(strSQL)
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="16%" align="center">
<p align="left">入库编号</td>
<td width="16%" align="center"> 采购人</td>
<td width="17%" align="center"> 品名</td>
<td width="17%" align="center"> 数量</td>
<td width="17%" align="center"> 单价</td>
<td width="17%" align="center">入库经手人</td>
</tr>
</table>
<%
DO WHILE NOT rs1.EOF
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
<tr>
<td width="16%" align="center"> <%=rs1("入库编号")%> </td>
<td width="16%" align="center"> <%=rs1("采购人")%> </td>
<td width="17%" align="center"> <%=rs1("品名")%> </td>
<td width="17%" align="center"> <%=rs1("数量")%> </td>
<td width="17%" align="center"> <%=rs1("单价")%> </td>
<td width="17%" align="center"> <%=rs1("入库经手人")%> </td>
</tr>
</table>
<% rs1.MOVENEXT
LOOP
%>
</body>
</html>
<%
rs1.close
set rs1=nothing
conn.close
set conn=nothing
%>Top




