F
fhp023
Unregistered / Unconfirmed
GUEST, unregistred user!
谢谢jack391
我先调试一下,但结果不对,就是昨日库存和今日库存两个库存不对
再帮我看看是哪个地方错了,代码:
CREATE PROCEDURE [p_a] @DateT DateTime AS
select A.mc,Sum(B.qckc) +Sum(B.rsc)-Sum(B.rxh) as jrkc,sum(A.rsc) as rsc,
Sum(A.ysc) as ysc,Sum(A.nsc) as nsc,Sum(A.rxh) as rxh,Sum(A.yxh) as yxh,Sum(A.nxh) as nxh,
Sum(A.qckc)+Sum(A.rsc)-Sum(A.rxh) as zrkc
from T_aa A,T_aa B
where convert(char(10),A.t1,102)=convert(char(10),B.t1-1,102) and convert(char(10),B.t1,102)=convert(char(10),@DateT,102) and A.mc=B.mc
Group By A.mc
GO
我先调试一下,但结果不对,就是昨日库存和今日库存两个库存不对
再帮我看看是哪个地方错了,代码:
CREATE PROCEDURE [p_a] @DateT DateTime AS
select A.mc,Sum(B.qckc) +Sum(B.rsc)-Sum(B.rxh) as jrkc,sum(A.rsc) as rsc,
Sum(A.ysc) as ysc,Sum(A.nsc) as nsc,Sum(A.rxh) as rxh,Sum(A.yxh) as yxh,Sum(A.nxh) as nxh,
Sum(A.qckc)+Sum(A.rsc)-Sum(A.rxh) as zrkc
from T_aa A,T_aa B
where convert(char(10),A.t1,102)=convert(char(10),B.t1-1,102) and convert(char(10),B.t1,102)=convert(char(10),@DateT,102) and A.mc=B.mc
Group By A.mc
GO