+ -
当前位置:首页 → 问答吧 → asp 报表如何显示

asp 报表如何显示

时间:2011-06-23

来源:互联网

<%
'response.buffer=true

y1=Trim(Request("y1"))
m1=Trim(Request("m1"))
t1=Trim(Request("t1"))
date1 =y1&"-"&m1&"-"&t1

y2=Trim(Request("y2"))
m2=Trim(Request("m2"))
t2=Trim(Request("t2"))
date2 =y2&"-"&m2&"-"&t2
if not IsDate (date1) or not IsDate(date2) or date1="" or date2="" then 
response.write "日期输入错误!"
else 
set rs = server.CreateObject("adodb.recordset")
  sql="select a.rukushijian as 入库时间,sum(cast(b.rkjiagehe as float))as 合计金额
  from pro_rukujiben a,pro_rukudan b 
  where a.rukubianhao=b.rukubianhao and rukushijian between '"&date1&"'and'"&date2&"'group by a.rukushijian"
  rs.PageSize = 25  
  rs.CursorLocation = 3
  rs.Open sql,conn,0,2,1  
  pre = true
  last = true
  page = trim(Request.QueryString("page"))
   
  if len(page) = 0 then
  intpage = 1
  pre = false
  else
  if cint(page) =< 1 then
  intpage = 1
  pre = false
  else
  if cint(page) >= rs.PageCount then
  intpage = rs.PageCount
  last = false
  else
  intpage = cint(page)
  end if
  end if
  end if
  if not rs.eof then
  rs.AbsolutePage = intpage
  end if


%>
<div align="center">
  <table width="766" height="34" border="0" cellpadding="1" cellspacing="0">
  <tr class="tr_southidc">
  <td><table width="766" height="34" border="0" cellpadding="1" cellspacing="0">
  <tr class="back_southidc">
  <td width="113"><div align="center">日期</div></td>
  <td width="113"><div align="center">合计金额</div></td>
  </tr>
  <%  
  for i=1 to rs.PageSize
  if rs.EOF or rs.BOF then exit for
  %>
  <tr class="tr_southidc">
  <td><div align="center"><%=rs("rukushijian")%></a></div></td>
  <td><div align="center"><%=rs("合计金额")%></div></td>
  <td>&nbsp;</td>

作者: lihui226   发布时间: 2011-06-23

Microsoft VBScript 编译器错误 错误 '800a0409' 

未结束的字符串常量 

/baobiao/scjiage.asp,行 25 

sql="select a.rukushijian as 入库时间,sum(cast(b.rkjiagehe as float))as 合计金额
-----------------------------------------------------------------^

作者: lihui226   发布时间: 2011-06-23

VBScript code
sql="select a.rukushijian as 入库时间,sum(cast(b.rkjiagehe as float))as 合计金额 from pro_rukujiben a,pro_rukudan b  where a.rukubianhao=b.rukubianhao and rukushijian between '"&date1&"' and '"&date2&"' group by a.rukushijian"

作者: aspwebchh   发布时间: 2011-06-23

sql="select a.rukushijian as 入库时间,sum(cast(b.rkjiagehe as float))as 合计金额
  from pro_rukujiben a,pro_rukudan b  
  where a.rukubianhao=b.rukubianhao and rukushijian between '"&date1&"'and'"&date2&"'group by a.rukushijian"
 
把这个生成的SQL语句先输出来看看

作者: lzp4881   发布时间: 2011-06-23

难道是你换行的关系?别换行吧。。

作者: tcwsyt   发布时间: 2011-06-23