Free for PREMIUM members
Go Premium for a chance to win a PS4. Enter to Win
select to_char(add_months(sysdate, -12 * (level - 1)), 'yyyy')
connect by level <= 11;
Open in new window
We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
WHERE YEAR(DateColumn) BETWEEN 2003 AND YEAR(GETDATE())
Select * from YourTable Where YEAR(yourdate)> 2003 and YEAR(yourdate)<=YEAR(GETDATE())
CREATE PROC year_list AS
CREATE TABLE #years (year_number int)
Declare @yr int = 2003
WHILE @yr <= YEAR(GETDATE())
INSERT INTO #years (year_number) VALUES(@yr)
SET @yr = @yr + 1
-- RETURN SET
SELECT year_number FROM #years
New feature! Upgrade and increase expert visibility of your issues with Priority Questions.