select * from vote where datepart(mm,convert(datetime,borth))=12
还是不行啊,我在SQL查询分析器里面可以,怎么在asp里面就又是这样报错了呢?!
select month(字段名) from table
虽然borth是varchar,但里面的值都是日期格式的啊如:1955-12-27, 我在SQL里面 select borth from vote where datepart(mm,convert(datetime,borth))=12没问题,但在ASP里面就报错了?郁闷
select borth from vote where datepart(mm,convert(datetime,borth))=12 這樣寫不會有錯呀,如果borth是char的
select * from vote where datepart('mm',convert(datetime,borth))=12
select borth from vote where datepart(mm,convert(datetime,borth))=12 我用这个在SQL查询分析器里面发现查询结果的最后也有错误报告Server: Msg 8115, Level 16, State 2, Line 1 Arithmetic overflow error converting expression to data type datetime.请问有比较严谨的语句吗?!
select borth from vote where substring (borth,6,2)=12
select borth from vote where substring (borth,6,2)='12'
或者 select borth from vote where borth like '_____12%'
我在SQL里面
select borth from vote where datepart(mm,convert(datetime,borth))=12没问题,但在ASP里面就报错了?郁闷
這樣寫不會有錯呀,如果borth是char的
我用这个在SQL查询分析器里面发现查询结果的最后也有错误报告Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type datetime.请问有比较严谨的语句吗?!
select borth from vote where borth like '_____12%'