开发者

SQL Query Select OR using another Table [closed]

开发者 https://www.devze.com 2023-03-12 00:37 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous,开发者_JS百科 vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. F
It's difficult to tell what is being asked here. This question is ambiguous,开发者_JS百科 vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

How can I make this work ?

strQuery = "
SELECT UNIT_NO,DRIVER1,DRIVER2,PHONENUMBER,PHONENUMBER_2,PHONE1,PHONENUM2
from UNITS
where PHONENUMBER=" & objRS("PHONE") &
  "OR " & PHONENUMBER_2=" & objRS("PHONE") &
  "OR " & PHONE1=" & objRS("PHONE") &
  "OR " & PHONENUM2=" & objRS("PHONE")"

Thanks for any help...


strQuery = "
SELECT UNIT_NO,DRIVER1,DRIVER2,PHONENUMBER,PHONENUMBER_2,PHONE1,PHONENUM2
from UNITS
where PHONENUMBER=" & objRS("PHONE") &
  " OR PHONENUMBER_2=" & objRS("PHONE") &
  " OR PHONE1=" & objRS("PHONE") &
  " OR PHONENUM2=" & objRS("PHONE")


Try surrounding your values with ' characters.

0

精彩评论

暂无评论...
验证码 换一张
取 消