SQL full/partial string matching?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stuart E. Wugalter

    SQL full/partial string matching?

    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


  • david epsom dot com dot au

    #2
    Re: SQL full/partial string matching?

    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" <wugalter@usc.e du> wrote in message
    news:c68tll$a0f $1@gist.usc.edu ...[color=blue]
    > 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[/color]
    have[color=blue]
    > 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[/color]
    other[color=blue]
    > records that are the same or that contain this pattern within a larger
    > string. The following records would be considered matches: "ABC" "ABCD"[/color]
    and[color=blue]
    > "XYABCG".
    >
    > (Unfortunately, I am just learning Access VBA, but I am quite familiar[/color]
    with[color=blue]
    > SQL. Hwever, I would appreciate any solutions offerred.
    >
    > Thanks in Advance, Stuart
    >
    >[/color]


    Comment

    Working...