Unable to get sql query in access 2007 to work

fllopez65

Registered User.
Local time
Today, 13:21
Joined
Sep 22, 2011
Messages
43
Folks
Below is an sql query in access 2007 that i'm trying to use to bring up any grantor and grantee field that involved the willmot family but its producing a big fat zero.
Can anyone offer a tip what I'm doing wrong:

SELECT Property.ID, Property.StNum, Property.StName, TitleSearch.ID, TitleSearch.Grantor, TitleSearch.Grantee
FROM Property, TitleSearch
WHERE (((TitleSearch.[Grantor]) Like 'Willm%')) OR (((TitleSearch.[Grantee]) Like 'Willm%'));

Tks
fllopez65
 
Is your query in Access? In Access the wildcard is *. I believe that the % is a wildcard for MySQL.
 
You shouldn't have a table named Property.
This is a reserved word.
Also shouldn't use %

Try Like "Willm"
 
You shouldn't have a table named Property.
This is a reserved word.
Also shouldn't use %

Try Like "Willm"

Property is the actual name of the table where some of the necessary fields are, not sure how I can get around not using it.
 
tblProperty will do.

SQL is not MySql while they are very similar they are not the same.

MS Access uses sql not MySql
 
tks to Alansidman,PNGBill,VBAInet, for your suggestions. I finally got it to work. As was suggested, I didn't need to use the property table, it caused alot of unnecessary problems. I only need the titlesearch table.
 
Folks
Below is an sql query in access 2007 that i'm trying to use to bring up any grantor and grantee field that involved the willmot family but its producing a big fat zero.
Can anyone offer a tip what I'm doing wrong:

SELECT Property.ID, Property.StNum, Property.StName, TitleSearch.ID, TitleSearch.Grantor, TitleSearch.Grantee
FROM Property, TitleSearch
WHERE (((TitleSearch.[Grantor]) Like 'Willm%')) OR (((TitleSearch.[Grantee]) Like 'Willm%'));

Tks
fllopez65

...I finally got it to work. As was suggested, I didn't need to use the property table, it caused alot of unnecessary problems. I only need the titlesearch table.


I am not sure how you got it to work without using one of the Tables that is used in the SELECT Statement. Having said that, I see two things that are wrong with the Query as written here:
  1. Your JOIN Format is incorrect for Access Queries. The proper format should be something like: SELECT {Property.ID, Property.StNum, Property.StName, TitleSearch.ID, TitleSearch.Grantor, TitleSearch.Grantee} FROM Property INNER JOIN TitleSearch ON {Whatever they JOIN ON}
  2. As the others have already said, MS Access Wildcard is "*", not "%".
 
Last edited:

Users who are viewing this thread

Back
Top Bottom