I have the following SP line in progress...
declare @time_period_id_current int
set @time_period_id_current = CAST(CAST(YEAR(GETDATE()) as char(4))+ '' + CAST(MONTH(GETDATE()) as char(4))as int)
Where I'm trying to convert the current year and month into and integer with YYYYMM format, i.e. 200604. The above line returns 20064.
How to change the above line to retain the leading '0' in the month?
Thanks in advance.