相关文章推荐
declare @o_date varchar(7) = '1100101'
select Convert(datetime,Convert(varchar,@o_date + 19110000))
2021-01-01 00:00:00.000
declare @o_date2 varchar(7) = '950101'
select Convert(datetime,Convert(varchar,@o_date2 + 19110000))
2006-01-01 00:00:00.000
declare @n_date varchar(10)
set @o_date='1100101'
select @n_date=convert(varchar,convert(int,SUBSTRING(@o_date,1,3))+1911)+SUBSTRING(@o_date,4,4)
select convert(datetime,@n_date)
2021-01-01 00:00:00.000
 
推荐文章