cast轉化問題
(select CARCONDITION.CONDITIONDIV from CARCONDITION
where (CAST(SUBSTRING(cast(CARCONDITION.RENTSTARTTIME as nvarchar),8,4)as bigint) <1159
or CAST(SUBSTRING(cast(CARCONDITION.RENTSTARTTIME as nvarchar),8,4)as bigint) =1159)
and (CAST(SUBSTRING(cast(CARCONDITION.RENTSTARTTIME as nvarchar),8,4)as bigint)>0
or CAST(SUBSTRING(cast(CARCONDITION.RENTSTARTTIME as nvarchar),8,4)as bigint) =0)
)as AM
and前面的區別就是後面的比較值(1159 和0 不一樣)
但是下面的(=0就是最後一條)會報錯
求解!
[解决办法]