日期:2014-05-18  浏览次数:20509 次

急~ 哪位大哥帮下忙
如何计算去年同日的数据   ?
给你我所有的积分.


------解决方案--------------------
select * from tablename where columnname = dateadd(year,-1,getdate())
------解决方案--------------------
select @lastyear_today_income= rea_amount
from ht_categorized_accounts_summary
where acc_date =dateadd(year,-1, '2006-12-13 ')
或者用getday()取去年今年的日期