Does anyone know the exact query for IN in the following senario...

I want to search for 2 columns for 1 mobile number (mobile, alternate mobile)

I am using the following query

strSQL = "select * from tblcontest where bar_mob_no IN('" & sSQL &"') or bar_alt_mob in('" & sSQL &"')"

But its hshowing the following error

Microsoft JET Database Engine- Error '80040e14'

Syntax error (missing operator) in query expression 'bar_mob_no IN(''44444444'') or bar_alt_mob in(''44444444'')'.

he syntax should be this
"select * from tbl_name where mobile_no in ('firstvalue','secondvalue')"
what i think
the expression which you are creating for search criteria, i mean,"SSql"
should contain single quotes and you should remove ingle uotes from query
i mean
instead of
strSQL = "select * from tblcontest where bar_mob_no IN('" & sSQL &"') or bar_alt_mob in('" & sSQL &"')"

use this
strSQL = "select * from tblcontest where bar_mob_no IN(" & sSQL &") or bar_alt_mob in(" & sSQL &")"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.