I have an T-SQL script that reads some 660 with many occurences of a certain date calculation:
Where rdb is the table alias used furtheron in the script.
Can I define a variable like:
And the use the declared variable in the sql part of the procedure in the next steps?
Ties Blom
Code:
CONVERT(DATETIME, CONVERT(VARCHAR(23), rdb.period_year * 10000 + rdb.period_month * 100 + 1), 112)
Where rdb is the table alias used furtheron in the script.
Can I define a variable like:
Code:
@date_from_year_month varchar(200)
set @date_from_year_month = 'CONVERT(DATETIME, CONVERT(VARCHAR(23), rdb.period_year * 10000 + rdb.period_month * 100 + 1), 112)'
And the use the declared variable in the sql part of the procedure in the next steps?
Ties Blom