如何用SQL把varchar型的转化成datetime型的
2个回答
展开全部
转换举例,请参考:
select cast('2016-2-20' as datetime)
select cast('2/20/2016' as datetime)
select cast('2016-2-20 11:22:33' as datetime)
select cast('2/20/2016 11:22:33.98' as datetime)
select cast('16-2-20' as datetime)
select cast('16-2-20 11:33:44' as datetime)
select cast('16/2/20' as datetime)
select cast('16/2/20 11:12:13:144' as datetime)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询