Re: Searching addresses

From: MarkyG <markg_at_mymail.tm>
Date: 28 Feb 2002 07:45:23 -0800
Message-ID: <ab87195e.0202280745.5ca0001d_at_posting.google.com>


The only way to do this *i think* is to separate each part of your input string and do an AND search on the relevant field

e.g

SELECT *
FROM table

WHERE address_line like '%N%'
AND address_line like '%Col%'
AND address_line like '%Pky%';

You may have a problem with the first search since your lines begin with N and i'm doind a wildcard search '%N%', should really be 'N%'. However, it gives you the general idea! You may want to create dynamic SQL to separate the users input and create your clause with enough searches.

M

"spare_brain" <spare_brain_at_yahoo.com> wrote in message news:<a5k366$mtg19_at_kcweb01.netnews.att.com>...
> Folks,
>
> I am trying to find examples of SQL snippets that shows an address search as
> follows. Such searches are very common in map searching.
>
> For example, the "Address_Line" attribute has entries of the form
>
> 100 N. Columbia Pky
> 100 N. Columbia Parkway
> 100 North Columbia Pky
> 100 North Columbia Parkway
> 222 North Columbia Pky
>
> Now, my search query should be such that when the user enters "N Col Pky",
> it should fetch all of these entries.
>
> Could someone provide some pointers, and/or other leads into finding similar
> examples?
>
> Any help would be great and save a SQLed soul.....so Thanks!
>
> sb
> -----------------------------
> "..Life is like a database query, you never know what'cha gonna get.."
Received on Thu Feb 28 2002 - 16:45:23 CET

Original text of this message