sql语句出错
求助:sql语句出错用VB写的程序,VB codeDim zz As Integerzz Text8.Text + 1ss.Open selectDRP From ST_
求助:sql语句出错
用VB写的程序,
VB codeDim zz As Integerzz = Text8.Text + 1ss.Open "select DRP From ST_PPTN_R where TM = CONVERT(DATETIME,'" & DTPicker7.Value & " " & zz & " :00:00')", cn
运行出错,提示:从char数据类型到datetime数据类型的转换导致datetime值越界
求助:错在哪里,怎么该?谢谢1
[解决办法]肯定是你给ZZ赋值时超过23了。
select CONVERT(DATETIME,'2012-02-01 26:00:00')
报错:
消息 242,级别 16,状态 3,第 1 行
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.