SQLTeam.com | Weblogs | Forums

Select statement using a recordset as the 'IN' filter


#1

I am embedding SQL queries in some VBA code. i need to create a recordset from one query and then write a second along the lines of

SELECT [column]
FROM [Table]
WHERE [Column] IN (recordset)

Ordinarily I would do a LEFT JOIN but in this instance i can't use that option. Is anyone aware of the correct syntax for this please?

Ed


#2

Ex:

select orderno
  from orders
 where order_id in (1,2,5)
;