Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I filter the recordset using IN Clause?

Status
Not open for further replies.

tonioJ

Programmer
Oct 7, 2002
90
PH
I want to filter my recordset using IN clause is it possible? The filter should be like the SQL statement below.


Select * from employees where emp_no in (1,2,3,4,5)

 
The SQL statement you provided seems to be correct:

SELECT * FROM [employees] WHERE [emp_no] IN (1,2,3,4,5);

So yes, it's possible ;)

Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
 
Thanks for your reply. so how will i do it in ADO using filter?

just like.

rs.filter = "emp_no IN (1,2,4,6)

i'm getting an error with this statement in VB.
 

rs.filter = "emp_no =1 Or emp_no = 2 Or emp_no = 4 Or emp_no = 6"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top