Hi,
I have a table which stores address data with one of the fields being a postcode field(or zip code for those of you who are american).
What I want to do is to pull out customers by particular postcode. The following is a list of postcodes that I want to select customers by, but they are only the beginning of the postcode.
PE, NR, IP, OB, SG, CO, CM, SS, RM, IG, E, N, EN, AL, EC
So I want to pull out customers who's postcodes start with the above. The problem that I have is that the entries in the list above that are only a single character. This means that we are looking for postcodes that start for example with an E and are then immediately followed by a number. The other postcodes start with two letters and are then followed by a number. If I did a search for "like E%" this would return anything starting with E and not those which are E followed by a number e.g E10 SLR, E25 XLT etc.
The postcode filed is of type nvarchar
How can I achieve the right result??
Cheers
Paul
I have a table which stores address data with one of the fields being a postcode field(or zip code for those of you who are american).
What I want to do is to pull out customers by particular postcode. The following is a list of postcodes that I want to select customers by, but they are only the beginning of the postcode.
PE, NR, IP, OB, SG, CO, CM, SS, RM, IG, E, N, EN, AL, EC
So I want to pull out customers who's postcodes start with the above. The problem that I have is that the entries in the list above that are only a single character. This means that we are looking for postcodes that start for example with an E and are then immediately followed by a number. The other postcodes start with two letters and are then followed by a number. If I did a search for "like E%" this would return anything starting with E and not those which are E followed by a number e.g E10 SLR, E25 XLT etc.
The postcode filed is of type nvarchar
How can I achieve the right result??
Cheers
Paul