[英]Int to Date in SQL SERVER 2000
如何将int列,Birthdate(样本值20090301)转换为格式为(01/03/2009)的date列Sql Server 2000
我正在尝试转换以下内容
select * from tabl
where
cast(dob as datetime)>='01/03/2009'
which gives an error
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type datetime.
尝试这个 !
select * from tabl
where
cast(convert(char(8),dob, 112) as date)>='2009-03-01'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.