|
|

楼主 |
发表于 2010/3/15 20:15:08
|
显示全部楼层
数据库名: UFDATA_001_2005
E:\U8SOFT\Admin\SQLFILE8710\Main\Ufdata\Structure\Data_STR_CA_mix_NL.sql
错误信息:
-2147217900
找不到列 "dbo" 或用户定义的函数或聚合 "dbo.caf_getaccinfo",或者名称不明确。
执行如下语句时出错:
create function [dbo].[CaF_GetBurFinAmount]
(
@iperiod as integer,
@dtBegin as datetime,
@dtend as datetime
)
returns TABLE
AS
return (
select A.irealcoid,A.cbatch,isnull(t1.f1,0)+isnull(t2.f2,0)-isnull(t3.f3,0)-isnull(t4.f4,0) + isnull(t5.idgqua,0) as BurFinAmount from ca_batchmap A
Left Join
(select cppid,cbatch,sum(isnulL(iqua,0) - isnull(iwastequa,0)) as f1
From ca_dacps
Where ddate>=@dtBegin and ddate<=@dtEnd
group by cppid,cbatch) as t1 on A.irealcoid = t1.cppid and A.cbatch = t1.cbatch
Left Join
(
select cppid,cbatch,ifinpdtamo as f2
From ca_enmop
Where iPeriod =@iperiod - 1
) as t2 on A.irealcoid=t2.cppid and A.cbatch=t2.cbatch
Left Join
(
select cppid,cbatch,ifinpdtamo as f3
From ca_enmop
Where iPeriod =@iperiod
) as t3 on A.irealcoid=t3.cppid and A.cbatch=t3.cbatch
Left Join
(
select cppid,cbatch,ilosingincost as f4
From ca_compd
Where iPeriod =@iperiod
) as t4 on A.irealcoid=t4.cppid and A.cbatch=t4.cbatch
left join
(select A.macoid as irealcoid,'' as cbatch,sum(isnull(iqua,0)) as idgqua from ca_aditional_use A
inner join ca_dacps B on A.irealcoid = B.cppid
where dbo.caf_getaccinfo('ca','8601','0') >= 1 and ddate>=@dtBegin and ddate<=@dtEnd
group by A.macoid
) t5 on A.irealcoid = t5.irealcoid |
|