太怪了谁能说明白!asp里sql的问题
qxb 2004-08-04 06:04:34 两段代码 在一个库中两个结构相同的access表中
else后的语句不能互用主要是??? 真他妈怪!!
第一个只能用 and prize<>'' 可以查出
第二个只能用 prize IS NULL 才可查出
互换不行
代码
sql = "Select Unid,title,writer,department from jiaoyan where 1 = 1 "
if Request("prize") <>"" then
if Request("prize")=1 then
sql = sql &"and prize<>''"
else
sql = sql &"and prize='' "
end if
end if
和
sql = "Select Unid,title,writer,department from keyan where 1 = 1 "
if Request("prize") <>"" then
if Request("prize")=1 then
sql = sql &"and prize<>''"
else
sql = sql &"and prize IS NULL "
end if
end if