选择OCRD.CardCode,OCRD.Cardname,
投 (
ISNULL((SELECT SUM(DocTotal)
从ORIN
哪里OCRD.CardCode = ORIN.CardCode
AND DocType ='I'
AND CANCELED ='N'
AND YEAR(DocDate)= YEAR(getdate())-1),0)/
NULLIF((选择SUM(DocTotal)
来自OINV
哪里OCRD.CardCode = OINV.CardCode
AND DocType ='I'
AND CANCELED ='N'
AND YEAR(DocDate)= YEAR(getdate())-1),0)AS十进制(5,2))AS'百分比'
来自OCRD
OCRD.CARDTYPE ='C'
AND OCRD.FROZENFOR ='N'
GROUP BY OCRD.CardCode,OCRD.CARDNAME
尊敬的OCRD.CardName
我使用了它,它可以正常工作。
一周热门 更多>