How to set dynamic date depending on current year

Giganews Newsgroups
Subject: How to set dynamic date depending on current year
Posted by:  staeri 74 (stae…@gmail.com)
Date: Mon, 27 Dec 2010

I insert some monthly data like this:

SET @CurrentYear = 2010

/* Insert periods in tblSYSTEMPeriod */
INSERT tblSYSTEMPeriod
(PeriodNo, PeriodDescription, DateBegin, DateEnd)
VALUES    (1, '2010-01', '2010-01-01', '2010-01-31'),
    (2, '2010-02', '2010-02-01', '2010-02-28')

I want to make this dynamic so that the year part in
PeriodDescription, DateBegin and DateEnd is based on @CurrentYear. How
can that be done in the easiest possible way?

// S

Replies