**********************请教一个函数使用问题********************
select DepotGoods.id ,
dbo.GetSellCount(DEpotGoods.Goodsid ,1, '03 31 2007 10:50PM ', '03 31 2007 10:50PM ') as SellAmount
from DepotGoods
inner join Goods on Goods.id = DepotGoods.GoodsID
where 1=1
and
(select typeid from Goods g where g.id = DepotGoods.goodsid)=1
and SellAmount > =1 and SellAmount <=1 and DEpotGoods.Amount > =1 and DEpotGoods.Amount <=1
上面的语句为什么提示
列名 'SellAmount ' 无效。
谢谢!!!!
------解决方案--------------------select
DepotGoods.id ,
dbo.GetSellCount(DEpotGoods.Goodsid ,1, '03 31 2007 10:50PM ', '03 31 2007 10:50PM ') as SellAmount
from DepotGoods
inner join Goods on Goods.id = DepotGoods.GoodsID
where 1=1
and (select typeid from Goods g where g.id = DepotGoods.goodsid)=1
and dbo.GetSellCount(DEpotGoods.Goodsid ,1, '03 31 2007 10:50PM ', '03 31 2007 10:50PM ') > =1
and dbo.GetSellCount(DEpotGoods.Goodsid ,1, '03 31 2007 10:50PM ', '03 31 2007 10:50PM ') <=1
and DEpotGoods.Amount > =1
and DEpotGoods.Amount <=1
------解决方案--------------------这么快