解决方案: |
修改数据库解决:
DROP TABLE #YXKP
CREATE TABLE #YXKP(sCardID varchar(20))
EXEC fa_Q_INSERT_YXKP '2005-12-01'
update fa_DeprTransactions set fa_DeprTransactions.lDeprMonths11=(year('2005-12-01')- year(fa_Cards.dStartdate))*12 + (month('2005-12-01')- month(fa_Cards.dStartdate))-1
FROM (#YXKP INNER JOIN fa_Cards ON fa_Cards.sCardID = #YXKP.sCardID)
INNER JOIN fa_DeprTransactions ON fa_Cards.sCardNum = fa_DeprTransactions.sCardNum
WHERE (fa_Cards.dDisposeDate) Is Null AND fa_DeprTransactions.lDeprMonths3 < fa_Cards.lLife
|