怎么没有显示?

panner 2008-11-28 03:47:21
select * from orders,order_details
where orders.OrdersID=order_details.OrdersID and orders.tag='1' and order_details.tag='1'
and orders.AdminID=1 and orders.orders_date>=#2008-11-1# and orders.orders_date<=#2008-11-28 23:59:59#
and orders.Order_remarks like '%%' and Orders.UserID=1 and order_details.procode='S302'
order by orders.Orders_Date

rs.open sql,conn,1,1

<%=rs("orders.OrdersID")%> 怎么没有结果显示出来?事实上有4条记录的!
...全文
52 点赞 收藏 8
写回复
8 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
panner 2008-11-28
自己搞定的
set rs=conn.execute(sql)
一切正常!
就当散分了,积分少的优先啊!大家别骂我!
回复
panner 2008-11-28
[Quote=引用 5 楼 toury 的回复:]
and orders.Order_remarks like '%%’

怎么会有数据呢
[/Quote]
模糊查询 就是该字段没有要求
回复
panner 2008-11-28
UserNameID=Clng(request.Form("UserNameID"))
if UserNameID<>"" then
UserIDStr=" and Orders.UserID="&UserNameID&""
end if
sql="select Orders.OrdersID,Orders.UserID,Orders.state,Orders.State_Date,Orders.Orders_Date,orders.Order_Remarks from orders,order_details where orders.OrdersID=order_details.OrdersID and orders.tag='1' and order_details.tag='1' and orders.AdminID="&AdminID&" and orders.orders_date>=#"&B_date&"# and orders.orders_date<=#"&E_date&"# and orders.Order_remarks like '%"&remarks&"%'"
ProCode=request.Form("ProCode")
if ProCode<>"" then
ProCodeStr=" and order_details.procode='"&procode&"'"
end if
sql=sql & UserIDStr
sql=sql & ProCodeStr & " order by orders.Orders_Date"
rs.open sql,conn,1,1
'循环显示结果
while not rs.eof
i=i+1
%>
<tr>
<td width="5%" align="center"><%=i%></td>
<td width="10%" align="right" nowrap="nowrap"><%=rs(0)%></td>
<td align="right" nowrap="nowrap"><%=rs("UserID")%> </td>
<td align="right" nowrap="nowrap"><%=rs("state")%> </td>
<td align="left" nowrap="nowrap"> <%=rs("State_Date")%></td>
<td align="left" nowrap="nowrap"><%=rs("Orders_Date")%> </td>
<td align="right" nowrap="nowrap"><%=rs("Orders_Remarks")%> </td>
<td align="center"><a href="OrdersUpdate.asp?OrdersID=<%=rs("Orders.OrdersID")%>" target="_blank">修改</a> <a href="OrdersDList.asp?OrdersID=<%=rs("OrdersID")%>" target="_blank">详细</a></td>
</tr>
<%
rs.movenext
wend
else
response.Write "<br>本次查询没有符合结果的记录!"
%>


结果是sql打印
SELECT Orders.OrdersID, Orders.UserID, Orders.state, Orders.State_Date,
Orders.Orders_Date, orders.Order_Remarks
FROM orders, order_details
WHERE orders.OrdersID = order_details.OrdersID AND orders.tag = '1' AND
order_details.tag = '1' AND orders.AdminID = 1 AND
orders.orders_date >= # 2008 - 11 - 01 # AND
orders.orders_date <= # 2008 - 11 - 28 # AND orders.Order_remarks LIKE '%%' AND
Orders.UserID = 1 AND order_details.procode = 'S302'
ORDER BY orders.Orders_Date
本次查询没有符合要求的记录!
sql在sql里执行的结果
200811060004 1 已下单 2008-11-6 11:54:08 2008-11-6 11:54:08 ceshi
200811060004 1 已下单 2008-11-6 11:54:08 2008-11-6 11:54:08 ceshi
200811240001 1 已下单 2008-11-24 11:17:01 2008-11-24 11:15:29 交货时间2008-11-24
200811260001 1 已下单 2008-11-26 11:02:39 2008-11-26 11:02:39 交货时间2008-11-26
回复
toury 2008-11-28
and orders.Order_remarks like '%%’

怎么会有数据呢
回复
sy_binbin 2008-11-28
select orders.OrdersID from orders,order_details
where orders.OrdersID=order_details.OrdersID and orders.tag='1' and order_details.tag='1'
and orders.AdminID=1 and orders.orders_date>=#2008-11-1# and orders.orders_date <=#2008-11-28 23:59:59#
and orders.Order_remarks like '%%' and Orders.UserID=1 and order_details.procode='S302'
order by orders.Orders_Date

你把你在页面上要显示的数据的字段在红色部分给写出来,不建议用*

然后<%=rs(0)%>



回复
panner 2008-11-28
18 1 200811060004 1 2008-11-6 11:54:08 1 已下单 2008-11-6 11:54:08 ceshi 3 31 S302 51 100 1 2008-11-6 15:38:40 1 那些曾经开办测电笔 200811060004
18 1 200811060004 1 2008-11-6 11:54:08 1 已下单 2008-11-6 11:54:08 ceshi 1 31 S302 15 100 1 2008-11-6 15:29:51 1 dedw 200811060004
23 1 200811240001 1 2008-11-24 11:15:29 1 已下单 2008-11-24 11:17:01 交货时间2008-11-24 9 31 S302 288 2 1 2008-11-24 11:15:42 1 200811240001
31 1 200811260001 1 2008-11-26 11:02:39 1 已下单 2008-11-26 11:02:39 交货时间2008-11-26 14 31 S302 26 321 1 2008-11-26 11:06:14 1 312 200811260001
查询分析器里的结果
执行语句
SELECT *
FROM orders, order_details
WHERE orders.OrdersID = order_details.OrdersID AND orders.tag = '1' AND
order_details.tag = '1' AND orders.AdminID = 1 AND
orders.orders_date >= # 2008 - 11 - 1 # AND
orders.orders_date <= # 2008 - 11 - 28 23 :59:59 # AND
orders.Order_remarks LIKE '%%' AND Orders.UserID = 1 AND
order_details.procode = 'S302'
ORDER BY orders.Orders_Date
回复
panner 2008-11-28
对啊
当然是符合条件的
我在sql管理器里看到的结果
回复
不耐烦 2008-11-28
select * from orders,order_details
where orders.OrdersID=order_details.OrdersID and orders.tag='1' and order_details.tag='1'
and orders.AdminID=1 and orders.orders_date>=#2008-11-1# and orders.orders_date <=#2008-11-28 23:59:59#
and orders.Order_remarks like '%%' and Orders.UserID=1 and order_details.procode='S302'
order by orders.Orders_Date

确定有符合条件的???
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2008-11-28 03:47
社区公告
暂无公告