本帖最后由 扬帆 于 2017-3-29 09:47 编辑
<!--#include file="conn2.asp"-->
<html>
<head>
</head>
<body>
<div align="center">
<!--#include file="top.htm"-->
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td height="327" valign="top"><table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="kuang1">
<tr>
<td width="152" height="575" valign="top" class="kuang"><table width="150" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="24" background="../bysj/images/you.gif"><span class="style3"><span class="style4">◆</span><span class="style6">条件搜索</span></span></td>
</tr>
<tr>
<td height="2" valign="top" bgcolor="#FFFFF7"></td>
</tr>
<tr>
<td height="27" valign="top"><table border="0">
<tr>
<td><table width="144" border="0">
<tr>
<td width="138" height="120" align="center" valign="middle" bordercolor="#000000" background="../bysj/IMAGES/nback.jpg" class="kuang1"><form method="POST" action="test2.asp">
<p>
<input name="date1" type="date" size="15" maxlength="15">
</p>
<p> </p>
<p>
<input name="date2" type="date" size="15" maxlength="15">
</p>
<p> </p>
<p></p>
<input type="submit" value="提交" name="B1" style="BACKGROUND-COLOR: #3165ff; BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px">
<p></p>
</form></td>
</tr>
</table></td>
<%dim date1,date2
date1=trim(request("date1"))
date2=trim(request("date2"))
session("date1")=trim(request("date1"))
session("date2")=trim(request("date2"))
%>
<tr>
<td width="592" valign="top"><table border="0" width="569" bordercolorlight="#000000" cellspacing="0" cellpadding="5" bordercolordark="#FFFFFF">
<tr>
<td width="67%" valign="top"><img src="../bysj/IMAGES/divider.gif" alt="" width="332" height="20"><span class="style10">最近预约的客户 <a href=test2-2.asp class="style2">导出EXCEL</a></span></td>
</tr>
<%set rs1=server.createobject("adodb.recordset")%>
<% sql="select 患者姓名,客户来源,病案号,组织机构,操作类型 ,套餐科别 ,套餐名称,是否全套套餐,收银员,销售时间,sum(实际支付)from( SELECT P.PERSON_NAME 患者姓名,pgcommon.fxGetCodeDesc(pt.hear_about_path) 客户来源,PGPMI.fxGetMRN(PT.PATIENT_ID,'MRTOP') 病案号,O.ORGANISATION_NAME 组织机构,PGCOMMON.fxGetCodeDesc(PATXN.PACKAGETXN_TYPE) 操作类型 ,rpcm.realpackagecatmstr_desc 套餐科别 ,PPA.REALPACKAGE_DESC 套餐名称,DECODE(PPA.FULL_IND, 'Y', '是', '否') 是否全套套餐,UM.USER_NAME 收银员,PATXN.ENTERED_DATETIME 销售时间,CC.COLLECTED_AMOUNT 实际支付 FROM PACKAGETXN PATXN,PATIENTPACKAGE PPA,PATIENT PT,PERSON P,ORGANISATION O,COUNTERCOLLECTION CC,USERMSTR UM,realpackagemstr rpm,Realpackagecatmstr rpcm WHERE PATXN.PATIENTPACKAGE_ID = PPA.PATIENTPACKAGE_ID AND PPA.PATIENT_ID = PT.PATIENT_ID AND PT.PERSON_ID = P.PERSON_ID AND PATXN.RECEIPT_ID = CC.RECEIPT_ID AND UM.USERMSTR_ID=CC.USERMSTR_ID AND PT.ORGANISATION_ID = O.ORGANISATION_ID(+) and PPA.REALPACKAGE_TYPE='PKTIPT'And ppa.realpackagemstr_id =rpm.realpackagemstr_id And rpm.realpackagecatmstr_id=rpcm.realpackagecatmstr_id and PATXN.ENTERED_DATETIME>=TO_DATE('"&date1&"','YYYY-MM-DD') and PATXN.ENTERED_DATETIME<TO_DATE('"&date2&"','YYYY-MM-DD') and ppa.realpackage_desc in ('自然分娩','剖腹产','自然分娩转剖腹产','剖腹产-特价房','自然分娩-特价房') and PATXN.ENTERED_DATETIME<trunc(sysdate) and PGPMI.fxGetMRN(PT.PATIENT_ID,'MRTOP') in(SELECT distinct PGPMI.fxGetMRN(PT.PATIENT_ID,'MRTOP') 病案号 FROM PACKAGETXN PATXN,PATIENTPACKAGE PPA,PATIENT PT,PERSON P,ORGANISATION O,COUNTERCOLLECTION CC,USERMSTR UM,realpackagemstr rpm,Realpackagecatmstr rpcm WHERE PATXN.PATIENTPACKAGE_ID = PPA.PATIENTPACKAGE_ID AND PPA.PATIENT_ID = PT.PATIENT_ID AND PT.PERSON_ID = P.PERSON_ID AND PATXN.RECEIPT_ID = CC.RECEIPT_ID AND UM.USERMSTR_ID=CC.USERMSTR_ID AND PT.ORGANISATION_ID = O.ORGANISATION_ID(+) and PGCOMMON.fxGetCodeDesc(PATXN.PACKAGETXN_TYPE) = '结退' and PPA.REALPACKAGE_TYPE='PKTIPT'And ppa.realpackagemstr_id =rpm.realpackagemstr_id And rpm.realpackagecatmstr_id=rpcm.realpackagecatmstr_id and PATXN.ENTERED_DATETIME>=TO_DATE('"&date1&"','YYYY-MM-DD') and PATXN.ENTERED_DATETIME<TO_DATE('"&date2&"','YYYY-MM-DD') and ppa.realpackage_desc in ('自然分娩','剖腹产','自然分娩转剖腹产','剖腹产-特价房','自然分娩-特价房') and PATXN.ENTERED_DATETIME<trunc(sysdate) ) ) group by 患者姓名, 客户来源, 病案号,组织机构,操作类型 , 套餐科别 ,套餐名称,是否全套套餐,收银员,销售时间 order by 病案号,套餐名称,销售时间"
%>
<%rs1.open sql,conn,3,1%>
<%
if Not(rs1.bof and rs1.eof) then
NumRecord=rs1.recordcount
rs1.pagesize=15
NumPage=rs1.Pagecount
if request("page")=empty then
NoncePage=1
else
if Cint(request("page"))<1 then
NoncePage=1
else
NoncePage=request("page")
end if
if Cint(Trim(request("page")))>Cint(NumPage) then NoncePage=NumPage
end if
else
NumRecord=0
NumPage=0
NoncePage=0
end if
%>
<tr>
<%if Not(rs1.bof and rs1.eof) then
rs1.move (Cint(NoncePage)-1)*15,1
for i=1 to rs1.pagesize
%>
<td width="9%" height="34"><div align="center">
<%=rs1("病案号")%>
<td width="9%" height="34"><div align="center"><%=rs1("患者姓名")%></div></td>
<td width="9%" height="34"><div align="center"><%=rs1("客户来源")%></div></td>
<td width="9%" height="34"><div align="center"><%=rs1("销售时间")%></div></td>
<td width="9%" height="34"><div align="center"><%=rs1("操作类型")%></div></td>
<td width="9%" height="34"><div align="center"><%=rs1("是否全套套餐")%></div></td>
<td width="9%" height="34"><div align="center"><%=rs1("收银员")%></div></td>
<td width="9%" height="34"><div align="center"><%=rs1("SUM(实际支付)")%></div></td>
</tr>
<%
rs1.movenext
if rs1.eof then exit for
next
else
response.write "<tr><td colspan=13><marquee scrolldelay=120 behavior=alternate>没有找到任何记录!!!</marquee></td></tr>"
end if
%>
<%
if NoncePage>1 then
response.write "|<a href=test2.asp?page=1>首 页</a>| |<a href=test2.asp?page="&NoncePage-1&">上一页</a>| "
else
response.write "|首 页| |上一页| "
end if
if Cint(Trim(NoncePage))<Cint(Trim(NumPage)) then
response.write "|<a href=test2.asp?page="&NoncePage+1&"date1="&request("date1") &"date2="&request("date2") &">下一页</a>| |<a href=test2.asp?page="&NumPage&">尾 页</a>|"
else
response.write "|下一页| |尾 页|"
end if
rs1.close
set rs1=nothing
%>
页次:<font color="#0033CC"><%=NoncePage%></font>/<font color="#0033CC"><%=NumPage%></font> 共<font color="#0033CC"><%=NumRecord%></font>条记录
<td width="9%" height="34"><div align="center"><%=date1%></div></td>
</table>
<hr size="1" noshade>
<p align="right" class="style8"><a href="../bysj/index.asp">退出系统</a></p></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td align="left" valign="top" class="kuang"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr bordercolorlight="#000000" bordercolordark="#FFFFFF">
<td valign="top"> </td>
</tr>
<tr bordercolorlight="#000000" bordercolordark="#FFFFFF">
<td valign="top">
</table>
<table width="760" height="63" border="0" cellpadding="0" cellspacing="0" class="kuang1">
<tr>
</body>
</html>
查询第一页显示没有问题,按下一页的时候就查不到数据了。但是如果不用表单查询提交条件查询,在SQL里面直接设定值。分页没问题。最开始认为是分页值没有传过去。后面用了date1="&request("date1") &"貌似还是不行,请高手看一看 |