积极答复者
运行时错误

问题
答案
-
转换之前用isdate()=1 过滤一下非法格式的时间。
select getdate() /* 2011-07-18 16:05:15.563 */ select cast(getdate() as smalldatetime) /* 2011-07-18 16:06:00 */
1、要保证char类型是可以转成时间格式的字符串。
2、长度不要太长,否则会出问题的。
- 已标记为答案 Stephanie Lv 2011年7月23日 12:24
全部回复
-
你好,
根据您的描述,您应该是在操作数据库时,对数据类型进行转换的时候发生了问题,所以我将会把您的问题移动到更为合适的论坛,以得到更好的支持。谢谢您的理解。
Rob Pan [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
转换之前用isdate()=1 过滤一下非法格式的时间。
select getdate() /* 2011-07-18 16:05:15.563 */ select cast(getdate() as smalldatetime) /* 2011-07-18 16:06:00 */
1、要保证char类型是可以转成时间格式的字符串。
2、长度不要太长,否则会出问题的。
- 已标记为答案 Stephanie Lv 2011年7月23日 12:24
-
运行时错误'-2147217913(80040*07)'
从char数据类型到smalldatetime数据类型的转换导致smalldatetime值越界
Hi:
从您提供的资料看起来不像时间格式
Shadowと愉快なコード達
Please correct me if my concept is wrong