为什么SQL的字段会出错
来源:百度知道 编辑:UC知道 时间:2024/06/20 15:03:24
<%
if not isnumeric(power_value) then power_value=100 end if
if (power_value < 4) then
set rs=Server.CreateObject("ADODB.recordset")
sql_where = " 1=1 "
if substation_id <> "" then
sql_where = sql_where & " and zdbit_worker.worker_substation = '" & substation_id & "'"
end if
if worker_id <> "" then
sql_where = sql_where & " and zdbit_score.s_workerId = '" & worker_id & "'"
end if
if worker_name <> "" then
sql_where = sql_where & " and zdbit_worker.worker_name = '" & worker_name & "'"
end if
if score_value <> "" then
sql_where = sql_where & " and zdbit_score.s_value = '" & score_value & "'"
end if
if substation_nam <> ""
if not isnumeric(power_value) then power_value=100 end if
if (power_value < 4) then
set rs=Server.CreateObject("ADODB.recordset")
sql_where = " 1=1 "
if substation_id <> "" then
sql_where = sql_where & " and zdbit_worker.worker_substation = '" & substation_id & "'"
end if
if worker_id <> "" then
sql_where = sql_where & " and zdbit_score.s_workerId = '" & worker_id & "'"
end if
if worker_name <> "" then
sql_where = sql_where & " and zdbit_worker.worker_name = '" & worker_name & "'"
end if
if score_value <> "" then
sql_where = sql_where & " and zdbit_score.s_value = '" & score_value & "'"
end if
if substation_nam <> ""
response一下sql看下吧 :)
ps : 错误是你自己写的还是copy的? 怎么感觉好像有些地方不对~~~
----------------------
就你贴的这部分不可能出现这个错误, 除非你在传递参数的过程中传递了这个错误的文字~~~~:)
把生成的SQL语句,直接在SQL企业管理器执行一下。
查看异常
要确保substation_nam能正确转成int哦。哥们,生成Where的方式好特别哦~