-- YYYMM TO YYYMMDD (FIRST DAY)
select @STR+'01';
-- YYYMM TO YYYMMDD (LAST DAY)
select @STR+CONVERT(VARCHAR, DAY(DATEADD(DAY, -1, DATEADD(M, 1, convert(datetime, convert(varchar, (SUBSTRING(@str, 1, 3)+1911))+SUBSTRING(@str, 4, 2)+'01', 112)))));
沒有留言:
張貼留言