求助!!!sqlserver varchar 转换date失败 高分相赠

convert(varchar,a.TF_CK_TIME,120) as "date1",
convert(varchar(120),a.TF_CK_TIME,120) as "date1",
convert(datetime,a.TF_CK_TIME) as "date1",
等都试过了 无效

Value 27.307785543038175 cannot be converted to TIMESTAMP.
Value 2017-09-08 12:10 cannot be converted to TIMESTAMP.
球球大神 帮忙解决高分相赠

你报的错是 2017-08-18 17:17这个值不能修改为时间戳,你这样转来转去为什么不用date类型呢?,把数据库和实体类都用Date类型
select convert(datetime,'2005-12-25',120)

select convert(smalldatetime,'2005-12-25',120)\

select cast('2005-12-25' as datetime)

select cast('2005-12-25' as smalldatetime)
你试试这些

你看下行不行
https://zhidao.baidu.com/question/1049328386625505619.html

是你想要的吗?

declare @va varchar(100) = '2017-09-08',
                @da date
select @da =  CONVERT(varchar(100), @va,0)
select @da

CONVERT(data_type(length),data_to_be_converted,style)
data_type(length) 规定目标数据类型(带有可选的长度)。data_to_be_converted 含有需要转换的值。style 规定日期/时间的输出格式。
你把style 换个格式 yyyy-mm-dd hh:mi:ss(24h)

希望能帮到你!

declare @char varchar(20)
set @char='2017-09-21 10:20'
select CONVERT(date,@char)
select CONVERT(datetime,@char)

这个是可以的

我估计是在 sqlserver 没问题呢,在mybatis就报错

convert(datetime,a.TF_CK_TIME,120) as "date1"

我想转换date类型 数据库是sqlserver , 数据库字段类型是varchar。
不处理就出现Value 2017-08-18 17:17 cannot be converted to TIMESTAMP.
mybaits脚本有问题,在数据库也不用处理 或者处理都没事。。。出现在这问题太多了

不处理是Value 2017-08-18 17:17 cannot be converted to TIMESTAMP.

一个表 convert(datetime,a.T_CK_KTIME,120) as "date1",
一个表convert(datetime,a.TF_CK_TIME,20) as "date1", 我醉了,sqlserver一点也不严谨啊。

最后发现 第二个 那个坑的 用啥都可以,表中经度纬度 出事了