Jump to content


Photo

Search problem


  • Please log in to reply
4 replies to this topic

#1 fazzfarrell

fazzfarrell
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 16 August 2006 - 09:21 AM

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!

#2 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 16 August 2006 - 10:04 AM

What does the shops.code column have in it? Try posting the actual code you're using.
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

#3 fazzfarrell

fazzfarrell
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 16 August 2006 - 10:26 AM

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





#4 otuatail

otuatail
  • Members
  • PipPipPip
  • Advanced Member
  • 960 posts

Posted 16 August 2006 - 11:08 AM

What happens if you just use postcodes.POSTCODE? do you get all the BB's etc.

Desmond.


#5 fazzfarrell

fazzfarrell
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 16 August 2006 - 11:13 AM

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'




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users