A
Adnil
Unregistered / Unconfirmed
GUEST, unregistred user!
--取上月总公司销售量
SELECT @iLastAmount = ISNULL(SUM(B.Amount), 0) FROM SaleGoods A, SaleGoodsInfo B WHERE A.SaleGoodsID = B.SaleGoodsID AND A.MakeDate BETWEEN DateAdd(Month, -1, @Date1) AND DateAdd(Month, -1, @Date2)
PRINT @iLastAmount
--取当月总公司销售量
SELECT @iThisAmount = ISNULL(SUM(B.Amount), 0) FROM SaleGoods A, SaleGoodsInfo B WHERE A.SaleGoodsID = B.SaleGoodsID AND A.MakeDate BETWEEN @Date1 AND @Date2
PRINT @iThisAmount
SELECT @iLastAmount = ISNULL(SUM(B.Amount), 0) FROM SaleGoods A, SaleGoodsInfo B WHERE A.SaleGoodsID = B.SaleGoodsID AND A.MakeDate BETWEEN DateAdd(Month, -1, @Date1) AND DateAdd(Month, -1, @Date2)
PRINT @iLastAmount
--取当月总公司销售量
SELECT @iThisAmount = ISNULL(SUM(B.Amount), 0) FROM SaleGoods A, SaleGoodsInfo B WHERE A.SaleGoodsID = B.SaleGoodsID AND A.MakeDate BETWEEN @Date1 AND @Date2
PRINT @iThisAmount