T-SQL如何將YYYYMMDDHHmmssnnn轉換為datetime

发布时间:2014-10-22 19:56:11
来源:分享查询网

DECLARE @tdatetime datetime; DECLARE @ttimestamp varchar(20); SET @ttimestamp = '20130829020000103'; SET @tdatetime = CONVERT(datetime,stuff(stuff(stuff(stuff(@ttimestamp, 9, 0, ' '), 12, 0, ':'), 15, 0, ':'),18,0,'.')); select @tdatetime;

返回顶部
查看电脑版