|
-
Oct 19th, 2006, 12:39 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] LIKE not working some times
Hi,
I have a VB6 program that uses ADO (2.5) and Access 97 DB
When I do an SQL SELECt using LIKE it works most times, but not when the text being queried is hard left in the DB record.
EG say I was searching for averly which occurs in the word Waverly.
If that word is in a record such as Mount Waverly, it gets a 'hit'
If that word was on the extreme left such as Waverly Gardens, it does not return a 'hit'
This is the query that was executing -
VB Code:
SELECT * FROM LeadsJobs WHERE JobNu<>0 AND CdJobAddress LIKE '%averly%'
Both the examples I mention above are present in the DB, but only the Mount Waverly record is returned.
Is this a bug, or an incompetent programmer ?
Would appreciate comments
-
Oct 19th, 2006, 01:31 PM
#2
Re: LIKE not working some times
I've never seen an issue like that before.. so I suspect the issue is something unrelated to the Like.
What are the JobNu values for those rows?
-
Oct 19th, 2006, 01:49 PM
#3
Thread Starter
Fanatic Member
Re: LIKE not working some times
JobNu is a Numeric field in Access (Long Integer0
The record with Waverly hard left has 6529 in the JobNu field
The record that is returned has 6553
Thanks
-
Oct 19th, 2006, 02:27 PM
#4
Re: LIKE not working some times
When things like this occur in MS Access something is corrupt. It is time to try a Repair...
-
Oct 19th, 2006, 03:44 PM
#5
Thread Starter
Fanatic Member
Re: LIKE not working some times
I prepared a simple example to post, but it worked ok.
So I examined every possibility, until I discovered that some one had spelled the offending record with ley on the end instead of ly. And then some idiot programmer didn't notice.
In my defence the user has been complaining about records not being found by the search. I have now requested that he send me a real example, when it next occurs.
Thanks to you both, for your time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|