⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchlistbycust.asp

📁 财务管理系统 报账等基本功能实现 有完整的实现
💻 ASP
字号:
<!--#include file="../Conndb.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet">
</head>
<body link="#000080" vlink="#080080">
<form id="form1" name="form1" method="POST">

<p align="center"><font color="#000080"><b><font style="font-size: 12pt">按客户统计</font></b></font></p> 
<table align=center border="1" cellspacing="0" width="100%" bordercolorlight="#000080" bordercolordark="#FFFFFF">
  <tr>
   <td width="40%" align="center" bgcolor="#C1E0FF"><strong>客户名称</strong></td>
   <td width="15%" align="center" bgcolor="#C1E0FF"><strong>采购总金额</strong></td>
   <td width="15%" align="center" bgcolor="#C1E0FF"><strong>退货总额</strong></td>
   <td width="30%" align="center" bgcolor="#C1E0FF"><strong>实际订单总金额</strong></td>
  </tr>
<%
  Dim rs
  Set rs = Server.CreateObject("ADODB.RecordSet")
  '读取数据到记录集rs中
  sql = "SELECT c.CustName,IsNull(SUM(l.st),0) AS st,IsNull(SUM(l1.st),0) AS rt," _
    + "(IsNull(SUM(l.st),0)-IsNull(SUM(l1.st),0)) AS rr" _
    + " FROM Customer c LEFT JOIN (Select SUM(l.Quantity*l.Price) AS st,l.CustId" _
    + " From Customer c ,PurProductList l Where c.CustId=l.CustId " _
    + " AND l.Flag=0 GROUP BY l.CustId) l ON c.CustId=l.CustId" _
    + " LEFT JOIN  (Select SUM(l.Quantity*l.Price) AS st,l.CustId" _
    + " From Customer c ,PurProductList l Where c.CustId=l.CustId " _
    + " AND l.Flag=1 GROUP BY l.CustId) l1 ON c.CustId=l1.CustId" _
    + " GROUP BY c.CustName"
  rs.Open sql,conn,1,1
  '在表格中显示记录
  If rs.Eof Then
    Response.Write "<tr><td colspan=4 align=center>目前还没有记录。</td></tr></table>"
  Else
    Do While Not rs.EOF
 %>
  <tr>
    <td align="left"><%=rs("CustName")%></td>
	<td align="right"><%=rs("st")%>&nbsp;</td>
	<td align="right"><%=rs("rt")%>&nbsp;</td>
	<td align="right"><%=rs("rr")%>&nbsp;</td>
  </tr>
  <%
      rs.MoveNext()
    Loop
  %>
</table>
<%End If%>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -