Jump to content

Archived

This topic is now archived and is closed to further replies.

fazzfarrell

Search problem

Recommended Posts

I have set up a seach to match postcodes

The postcodes are listed as WS, BB, CA, B etc.

The user types in say ws7 3uy I want the resuts to be anything related to WS.

I have this as my query:
SELECT postcodes.POSTCODE, shops.STORENAME, shops.UNITTYPE, shops.PERSILTEL, shops.PHOTOTEL, shops.ADDRESS1, shops.ADDRESS2, shops.TOWNCITY, shops.COUNTY, shops.POSTCODE, shops.EMAIL, shops.MANAGER, shops.LAUNDRY, shops.LAUNCHDATE, shops.OPENINGHOURS
FROM postcodes, shops
WHERE postcodes.POSTCODE LIKE colname% AND shops.CODE = postcodes.code

But it will only bring up my results if I type WS or BB etc. As soon as I tyoe in the full post code no result!

Any one help!

Share this post


Link to post
Share on other sites
The colum has example:
CODE
001
002
004
006
007
008

The postcode colum has example:
code POSTCODE
006 AL
014 AL
075 AL
062 AL
041 B
042 B
058 B
079 B



Share this post


Link to post
Share on other sites
What happens if you just use postcodes.POSTCODE? do you get all the BB's etc.

Desmond.

Share this post


Link to post
Share on other sites
No say if I type BB19 3uy it finds nothing. I want to be able to type the full postcode then it search just on the 'BB' part etc.

Some postcodes are b19 etc so it just needs to find 'b'

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.