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

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -