declare @startEndDate varchar(20)
declare @begdate varchar(20) --日期
select @startEndDate=convert(varchar,year(@begdate))+ case when len(month(@begdate))=1 then '0'+convert(varchar,month(@begdate)) else convert(varchar,month(@begdate)) end +case when len(day(@begdate))=1 then '0'+convert(varchar,day(@begdate)) else convert(varchar,day(@begdate)) end
select @startEndDate=convert(varchar,(dateadd(mm, datediff(mm,0,@startEndDate), 30)),120)
print(@startEndDate)