By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,640 Members | 2,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,640 IT Pros & Developers. It's quick & easy.

SQL full/partial string matching?

P: n/a
Hiya Folks!

I need some help with some string pattern matching. Let's say field1 (in
Table1) contains the strings in question and it's data type is memo. I have
a form that uses Table1 as its source and field1 is on this form. My user
wants to choose field1 for any record and be able to do a complete or
partial match with field1 in all other records in Table1. Preferably this
would be done by an event (e.g., double-click) or a command button on the
form.

For example, suppose field1 for record 1 is: "ABC" I want to find any other
records that are the same or that contain this pattern within a larger
string. The following records would be considered matches: "ABC" "ABCD" and
"XYABCG".

(Unfortunately, I am just learning Access VBA, but I am quite familiar with
SQL. Hwever, I would appreciate any solutions offerred.

Thanks in Advance, Stuart
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Perhaps something like this as the form recordsource:
(air code)

select * from tbl
where (instr(tbl.mfld,forms!frm!ctrl) <> 0)
or (forms!frm!ctrl = "")

(david)

"Stuart E. Wugalter" <wu******@usc.edu> wrote in message
news:c6**********@gist.usc.edu...
Hiya Folks!

I need some help with some string pattern matching. Let's say field1 (in
Table1) contains the strings in question and it's data type is memo. I have a form that uses Table1 as its source and field1 is on this form. My user
wants to choose field1 for any record and be able to do a complete or
partial match with field1 in all other records in Table1. Preferably this
would be done by an event (e.g., double-click) or a command button on the
form.

For example, suppose field1 for record 1 is: "ABC" I want to find any other records that are the same or that contain this pattern within a larger
string. The following records would be considered matches: "ABC" "ABCD" and "XYABCG".

(Unfortunately, I am just learning Access VBA, but I am quite familiar with SQL. Hwever, I would appreciate any solutions offerred.

Thanks in Advance, Stuart

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.