This commit is contained in:
gongxh
2021-12-06 16:24:35 +08:00

View File

@@ -870,7 +870,7 @@ select *from tempdb..tablepzck20210526
(SELECT ipesodid, sum(iQuantity) AS cqty
FROM rdrecords32 WITH (nolock)
GROUP BY ipesodid) dd on isnull(dd.ipesodid,'')=isnull(aa.iSOsID ,'')
where aa.cInvCode=a.cInvCode and bb.cVerifier is not null and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
where aa.cInvCode=a.cInvCode and isnull( bb.cCloser ,'') ='' and bb.cVerifier is not null and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
group by aa.cInvCode
) )>0 then 0 else (
isnull(
@@ -882,7 +882,7 @@ select *from tempdb..tablepzck20210526
(SELECT ipesodid, sum(iQuantity) AS cqty
FROM rdrecords32 WITH (nolock)
GROUP BY ipesodid) dd on isnull(dd.ipesodid,'')=isnull(aa.iSOsID ,'')
where aa.cInvCode=a.cInvCode and bb.cVerifier is not null and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
where aa.cInvCode=a.cInvCode and isnull( bb.cCloser ,'') =''and bb.cVerifier is not null and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
group by aa.cInvCode
) ) end as kcyl
,