samedi 31 janvier 2015

finding text in a string


I am trying to find records where the post code starts with a certain set of characters from some 10,000 records, 1300 or so of which meet the select below. My code is


Select * from table where mid(postcode,1,2 ) IN ("CV DE LE MK NN")


This returns a zero result A typical postcode would be something like CV1 9AD


If I write


Select * from table where mid(postcode,1,2 ) = "CV"


I get the full list of records for post codes beginning with "CV" I would have thought that the IN statement would work. Can anyone tell me why it does not?





Aucun commentaire:

Enregistrer un commentaire