<%@ page language="java" pageEncoding="GBK"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.zy.dao.TotalDao"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.text.DateFormat"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.text.DecimalFormat"%>
<html>
<head>
<title>即时FYC查询表</title>
<link rel="stylesheet" type="text/css" href="Admin_STYLE.CSS">
</head>
<body>
<br>
<p align="center"><font size="6">即时FYC查询</font><br><br>
<form>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr class="tdbg">
<td width="80" height='28' align="right">
</td>
<td>
<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<td height='28' align='center'>
起始时间:
<input type="text" name="startTime" size="15" maxlength="15">
结束时间:
<input type="text" name="endTime" size="15" maxlength="15">
<input type="submit" name="Submit" value="查询">
</td>
</tr>
</table>
</td>
</tr>
</table>
<br><br>
<table width="700" align="center" class="border" border="0" cellspacing="1" cellpadding="1">
  <tr class="title" height="22">
    <td width="7%" align="center"><b></td>
    <td width="7%" align="center"><b></td>
    <td width="7%" align="center"><b></td>
    <td width="7%" align="center"><b></td>
    <td width="7%" align="center"><b></td>
    <td width="7%" align="center"><b></td>
    <td width="7%" align="center"><b></td>
  </tr>
<%
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=gcit";
String user="***";
String password="***";
Connection con=DriverManager.getConnection(url,user,password);
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select a.agentcode,a.legalname,a.agenttype,case b.paymode when '0' then b.ifyp/10 else b.ifyp end SFYP,count(c.policyno),c.poltype,sum(cast(d.commamt as money)) FYC from gcdata..agent a,gcit..submission b,gcdata..lpolicy c,gcdata..acomhist d where a.carriercode='y' and a.agentcode>='82200001' and a.agentcode<'92200001' and a.legalname not in ('SM LN','LN HR') and a.agentcode=b.agentcode and a.bizsrc=b.channel and b.proposalno = c.proposalno and c.poltype in ('li','pa') and a.agentcode = d.agentcode and commcode in ('le') and commtype in ('ec') and d.policyno=c.policyno and d.currcycledate>=':panam1' and d.currcycledate<=':panam2' and b.subdate>='2008-01-28' and b.subdate<='2008-02-03' group by c.policyno,a.agentcode,a.legalname,agenttype,b.ifyp,b.paymode,c.poltype";
sql = sql.replaceAll(":panam1",request.getParameter("startTime"));
sql = sql.replaceAll(":panam2",request.getParameter("endTime"));
ResultSet rs=stmt.executeQuery(sql);
DecimalFormat format = new DecimalFormat("#.#");
    Object obj[] = new Object[8];
     while (rs.next()&&rs!=null) {
      obj[0] = rs.getString(1);
      obj[1] = rs.getString(2);
      obj[2] = rs.getString(3);
      obj[3] = new Double(rs.getDouble(4));
      obj[4] = rs.getString(5);
      obj[5] = rs.getString(6);
      obj[6] = new Double(rs.getDouble(7));
      %>
<tr>
<td width="7%" align="center" height="20" bgcolor="#FFFF8C"><%out.print(obj[0]);%></td>
<td width="7%" align="center" height="20" bgcolor="#C6AAFF"><%out.print(obj[1]);%></td>
<td width="7%" align="center" height="20" bgcolor="#C6EBDE"><%out.print(obj[2]);%></td>
<td width="7%" align="center" height="20" bgcolor="#FF99CC"><%out.print(format.format(obj[3]));%></td>
<td width="7%" align="center" height="20" bgcolor="#99CC66"><%out.print(obj[4]);%></td>
<td width="7%" align="center" height="20" bgcolor="#BFDFFF"><%out.print(obj[5]);%></td>
<td width="7%" align="center" height="20" bgcolor="#FFCCFF"><%out.print(format.format(obj[6]));%></td>
</tr>
<%
}
%>
<%
rs.close();
stmt.close();
con.close();
%>
</table>
</form>
<br><br>
</body>
</html>
帮忙修改一下,在当页输入起始和结束日期,显示查询结果