name field

J

jb ellis

I have a name field that is text in a personal type address book database.
Some relatives keep their own names when they marrry and I would like to
build a querry that picks up any record that has either name. For example,
if Joe Smith marries Jane Doe and field contains name as Smith/Doe, I want to
be able to querry on Smith or Doe and include this record.
 
M

MGFoster

jb said:
I have a name field that is text in a personal type address book database.
Some relatives keep their own names when they marrry and I would like to
build a querry that picks up any record that has either name. For example,
if Joe Smith marries Jane Doe and field contains name as Smith/Doe, I want to
be able to querry on Smith or Doe and include this record.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use the Like operator in the WHERE clause:

WHERE LastName Like "Smith/*"

or

WHERE LastName Like "*/Doe"

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9f7s4echKqOuFEgEQIbLgCg9i7WGY7+XwmBjKRX7c0gh+DLziwAoLDv
kz8KXScpJSosLkkB1jK0i6U2
=M27w
-----END PGP SIGNATURE-----
 
J

jb ellis

Thanks for the help. Maybe I worded the question poorly. I wanted a user to
be able to input any name in the querry. Your Like / Or statement only works
for those two specific names.
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

WHERE LastName Like [Search for Last Name] & "/*"

[Search for Last Name] is the query prompt.

Not the best solution 'cuz the user can enter "Smith*"
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9gmBYechKqOuFEgEQKZjgCgywC+D9NQmla/qHvRfWcBSeI/lIYAoP90
VBSHgyP3v5U4mcEpgg2k/jR/
=OrFD
-----END PGP SIGNATURE-----
 
J

jb ellis

Sorry, I'm a beginner and really apreciate the help. Querry using
WHERE LastName Like [Search for Last Name] & "/*"
didn't find any records.

for table:
Contact ID First Name Last Name
1 jane doe
2 john doe
3 frank smith
4 jane smith-doe
5 mary doe/smith

Criteria of Like "*doe*" works fine but how do I change
similar to your suggestion of "[Search for Last Name]" so I can search for
input?
MGFoster said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

WHERE LastName Like [Search for Last Name] & "/*"

[Search for Last Name] is the query prompt.

Not the best solution 'cuz the user can enter "Smith*"
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9gmBYechKqOuFEgEQKZjgCgywC+D9NQmla/qHvRfWcBSeI/lIYAoP90
VBSHgyP3v5U4mcEpgg2k/jR/
=OrFD
-----END PGP SIGNATURE-----

jb said:
Thanks for the help. Maybe I worded the question poorly. I wanted a user to
be able to input any name in the querry. Your Like / Or statement only works
for those two specific names.

:
 
J

John Spencer

Pardon me for jumping in.

WHERE [LastName] Like "*" & [Search for Last Name] & "*"


jb ellis said:
Sorry, I'm a beginner and really apreciate the help. Querry using
WHERE LastName Like [Search for Last Name] & "/*"
didn't find any records.

for table:
Contact ID First Name Last Name
1 jane doe
2 john doe
3 frank smith
4 jane smith-doe
5 mary doe/smith

Criteria of Like "*doe*" works fine but how do I change
similar to your suggestion of "[Search for Last Name]" so I can search for
input?
MGFoster said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

WHERE LastName Like [Search for Last Name] & "/*"

[Search for Last Name] is the query prompt.

Not the best solution 'cuz the user can enter "Smith*"
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9gmBYechKqOuFEgEQKZjgCgywC+D9NQmla/qHvRfWcBSeI/lIYAoP90
VBSHgyP3v5U4mcEpgg2k/jR/
=OrFD
-----END PGP SIGNATURE-----

jb said:
Thanks for the help. Maybe I worded the question poorly. I wanted a
user to
be able to input any name in the querry. Your Like / Or statement only
works
for those two specific names.

:


jb ellis wrote:

I have a name field that is text in a personal type address book
database.
Some relatives keep their own names when they marrry and I would like
to
build a querry that picks up any record that has either name. For
example,
if Joe Smith marries Jane Doe and field contains name as Smith/Doe, I
want to
be able to querry on Smith or Doe and include this record.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use the Like operator in the WHERE clause:

WHERE LastName Like "Smith/*"

or

WHERE LastName Like "*/Doe"

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9f7s4echKqOuFEgEQIbLgCg9i7WGY7+XwmBjKRX7c0gh+DLziwAoLDv
kz8KXScpJSosLkkB1jK0i6U2
=M27w
-----END PGP SIGNATURE-----
 
J

jb ellis

Thanks for "jumpimg in"; worked fine. Been working on this 2 days.

John Spencer said:
Pardon me for jumping in.

WHERE [LastName] Like "*" & [Search for Last Name] & "*"


jb ellis said:
Sorry, I'm a beginner and really apreciate the help. Querry using
WHERE LastName Like [Search for Last Name] & "/*"
didn't find any records.

for table:
Contact ID First Name Last Name
1 jane doe
2 john doe
3 frank smith
4 jane smith-doe
5 mary doe/smith

Criteria of Like "*doe*" works fine but how do I change
similar to your suggestion of "[Search for Last Name]" so I can search for
input?
MGFoster said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

WHERE LastName Like [Search for Last Name] & "/*"

[Search for Last Name] is the query prompt.

Not the best solution 'cuz the user can enter "Smith*"
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9gmBYechKqOuFEgEQKZjgCgywC+D9NQmla/qHvRfWcBSeI/lIYAoP90
VBSHgyP3v5U4mcEpgg2k/jR/
=OrFD
-----END PGP SIGNATURE-----

jb ellis wrote:
Thanks for the help. Maybe I worded the question poorly. I wanted a
user to
be able to input any name in the querry. Your Like / Or statement only
works
for those two specific names.

:


jb ellis wrote:

I have a name field that is text in a personal type address book
database.
Some relatives keep their own names when they marrry and I would like
to
build a querry that picks up any record that has either name. For
example,
if Joe Smith marries Jane Doe and field contains name as Smith/Doe, I
want to
be able to querry on Smith or Doe and include this record.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use the Like operator in the WHERE clause:

WHERE LastName Like "Smith/*"

or

WHERE LastName Like "*/Doe"

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ9f7s4echKqOuFEgEQIbLgCg9i7WGY7+XwmBjKRX7c0gh+DLziwAoLDv
kz8KXScpJSosLkkB1jK0i6U2
=M27w
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top