在SQL Server 2008中将nvarchar转换为datetime算术溢出 [英] Convert nvarchar to datetime in SQL Server 2008 arithmetic overflow

查看:310
本文介绍了在SQL Server 2008中将nvarchar转换为datetime算术溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 3/7/2013 格式的 nvarchar 值转换为 datetime 但我不能弄清楚。我使用SQL Server 2008并继续获取

I am trying to convert nvarchar values with the format 3/7/2013 to datetime but I can't quite figure it out. I am using SQL Server 2008 and keep getting an


将表达式转换为数据类型datetime的算术溢出错误

Arithmetic overflow error converting expression to data type datetime

错误。

推荐答案

b
$ b

This works fine:

SELECT CAST (N'3/7/2013' as datetime)

这篇关于在SQL Server 2008中将nvarchar转换为datetime算术溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆