我尝试了下面的代码,但它用破折号存储日期,例如2016-10-12
。
Declare @dts table
(
a date
)
insert into @dts (a)
select format(cast('20161012' as date),'yyyyMMdd')
select * from @dts
答案 0 :(得分:0)
int数据类型怎么样?
Declare @dts table
(
a int
)
insert into @dts (a)
select format(cast('20161012' as date),'yyyyMMdd')
select * from @dts