sql server - T-SQL : Get Current + Previous years from date table -


i have year values 2009 2015 in date table. want years min(year) current(year).

how can achieve this?

thank you

just select thouse "smaller or equal" current year

select * table datepart(year, date) <= datepart(year, getdate()) 

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -