SQL Query Select OR using another Table [closed]
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.
精彩评论