I have one date column MyDate
and I want those records in which MyDate
should be less than current date by 2 years.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
For DB2 you can use this
MYDATECOLUMN < CURRENT DATE - 2 YEAR
回答2:
if DB Server = MS SQL , then try :-
select *
from myTable
where MyDate < dateadd(year, -2, getdate())