The general problem w/ the LIKE structure using %::Organisation::% is it is looking for a match that has anything (something) before
and also after 'Organisation' (due to the % wildcard)
So you will not get a hit for any word that is the first or last word in the DB field
(since there is nothing before the first word or after the last word in that field)
If your record is 'Bloggs Building' there is no way for a match w/a wildcard on it using the LIKE and the wild card
(the field would need to be ' Bloggs Building ' to find Bloggs - that has something before and after Bloggs - a space)
--
| This shouldn't make any difference, but try:
|
| SELECT * FROM TF
| WHERE (NO_BLDG LIKE '%::Organisation::%')
| OR (AD_LINE_1 LIKE '%::Organisation::%')
| OR (AD_LINE_2 LIKE '%::Organisation::%')
| OR (AD_LINE_3 LIKE '%::Organisation::%')
| OR (AD_LINE_4 LIKE '%::Organisation::%')
| OR (AD_POSTCODE LIKE '%::Organisation::%')
| OR (NM_CUSTOMER LIKE '%::Organisation::%')
|
| Also, inspect your input values and data values *very* carefully for extra
| spaces, apostrophes, percent signs, and so forth.
|
| Jim Buyens
| Microsoft MVP
|
http://www.interlacken.com
| Author of:
| *----------------------------------------------------
||\---------------------------------------------------
||| Microsoft Windows SharePoint Services Inside Out
||| Microsoft Office FrontPage 2003 Inside Out
|||---------------------------------------------------
||| Web Database Development Step by Step .NET Edition
||| Microsoft FrontPage Version 2002 Inside Out
||| Faster Smarter Beginning Programming
||| (All from Microsoft Press)
||/---------------------------------------------------
| *----------------------------------------------------
|
|
| "Skc" wrote:
|
| > Sorry - what I mean't was that it is not working 100%.
| >
| > E.g. if I type in Smith and get back 50 roads called Smith Street. There
| > maybe a building name called Bloggs. When I enter Bloggs, I would expect to
| > get Smith Street - but I don't get Smith Street.
| >
| > Very odd. Any help now? Thanks.
| >
| > "Jim Buyens" wrote:
| >
| > > What is this code doing that you don't like?
| > >
| > > Or contrawise, what is it not doing that you wish it did?
| > >
| > > Jim Buyens
| > > Microsoft MVP
| > >
http://www.interlacken.com
| > > Author of:
| > > *-----------------------------Â-----------------------
| > > |\----------------------------Â-----------------------
| > > || Microsoft Windows SharePoint Services Inside Out
| > > || Microsoft Office FrontPage 2003 Inside Out
| > > ||----------------------------Â-----------------------
| > > || Web Database Development Step by Step .NET Edition
| > > || Microsoft FrontPage Version 2002 Inside Out
| > > || Faster Smarter Beginning Programming
| > > || (All from Microsoft Press)
| > > |/----------------------------Â-----------------------
| > > *-----------------------------Â-----------------------
| > >
| > > "Skc" wrote:
| > >
| > > > I want to do wildcard searches on fields in a table regardless of what is
| > > > entered.
| > > >
| > > > I have done this:
| > > >
| > > > SELECT * FROM TF WHERE (NO_BLDG LIKE '%::Organisation::%' OR AD_LINE_1 LIKE
| > > > '%::Organisation::%' or AD_LINE_2 LIKE '%::Organisation::%' or AD_LINE_3
| > > > LIKE '%::Organisation::%' or AD_LINE_4 LIKE '%::Organisation::%' or
| > > > AD_POSTCODE LIKE '%::Organisation::%' or NM_CUSTOMER LIKE
| > > > '%::Organisation::%')
| > > >
| > > > However, this is now working 100%.
| > > >
| > > > Can someone help?
| > > >
| > > > skc