Search code examples
ms-accessin-clause

MS Access IN operator not returning rows


Using an MS Access database (I know), the query below

SELECT * FROM PageImage WHERE (PageImage.Rooms) In ('1');

only returns rows when the 'PageImage.Rooms' column has a single value like 1

The actual data stored in the 'PageImage.Rooms' column is a comma separated list like 1,2,3 stored as a string, but no data is returned when this is the case.

From the above query & referring to the image below, only row 342 is returned, when I expect 341,342,343 to be returned

enter image description here


Solution

  • I decided to scrap the multi-value string field & go down the correct route of creating a mappings table