basflowsubsistence as jttoday, basflowsubsistence as jtyesterday, yuancaiFlow_view as ph, basflowsubsistence as phtoday, basflowsubsistence as phyesterday, yuancaiFlow_view as zj where a.productid = b.productid --hj and hj.productiondate = '2004-3-1' and left(a.productid, 4) *= left(hj.productid, 4) and hj.productid like '____06' and left(a.productid, 4) + '06' *= hjtoday.productid and hjtoday.checkdate = '2004-3-1' and left(a.productid, 4) + '06' *= hjyesterday.productid and hjyesterday.checkdate = '2004-2-29' --sx and sx.productiondate = '2004-3-1' and left(a.productid, 4) *= left(sx.productid, 4) and sx.productid like '____08' and left(a.productid, 4) + '08' *= sxtoday.productid and sxtoday.checkdate = '2004-3-1' and left(a.productid, 4) + '08' *= sxyesterday.productid and sxyesterday.checkdate = '2004-2-29' --jt and jt.productiondate = '2004-3-1' and left(a.productid, 4) *= left(jt.productid, 4) and jt.productid like '____07' and left(a.productid, 4) + '07' *= jttoday.productid and jttoday.checkdate = '2004-3-1' and left(a.productid, 4) + '07' *= jtyesterday.productid and jtyesterday.checkdate = '2004-2-29' --ph and ph.productiondate = '2004-3-1' and left(a.productid, 4) *= left(ph.productid, 4) and ph.productid like '____09' and left(a.productid, 4) + '09' *= phtoday.productid and phtoday.checkdate = '2004-3-1' and left(a.productid, 4) + '09' *= phyesterday.productid and phyesterday.checkdate = '2004-2-29' --zj and zj.productiondate = '2004-3-1' and left(a.productid, 4) *= left(zj.productid, 4) and zj.productid like '01__11' go drop table #productid go
准备用ASP呈现报表,结果ASP端的Recordset老提示出错。只好改用函数:
-- ============================================= -- Create table function (TF) -- ============================================= IF EXISTS (SELECT * FROM sysobjects WHERE name = N'fn_GetGLSubsistenceList') DROP FUNCTION fn_GetGLSubsistenceList GO
CREATE FUNCTION fn_GetGLSubsistenceList |