SQLServer从nvarchar数据类型到datetime数据类型的转换产生一个超出范围值的问题解决
程序员文章站
2022-06-16 13:22:52
报错语句:
cast(replace(replace(p.deliverdate,'.','-'),'/','-') as datet...
报错语句:
cast(replace(replace(p.deliverdate,'.','-'),'/','-') as datetime)
改为
cast(replace(replace(p.deliverdate,'.','-'),'/','-') as datetime2)
使用 datetime2 代替datetime