Creating a query that makes a comparison within a record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have one table that has records that contain information on different
properties. I want to create a query that shows all the records where the
owner address does not match the property address (which properties are
non-owner occupied). How do I do this?
 
Doug said:
I have one table that has records that contain information on different
properties. I want to create a query that shows all the records where the
owner address does not match the property address (which properties are
non-owner occupied). How do I do this?


Just use a WHERE clause that only accepts records where the
two fields a different.

WHERE OwnerAddress <> PropertyAddress

If the query design grid you can use a criteria under the
OwnerAddress field:
<> PropertyAddress
 
When I do that Access tells me that I have a data type mismatch even though
both fields I am comparing are numbers. Access insists on putting the field
name in quotes. Does this change it to text? How do I keep this from
happening?
 
Doug said:
When I do that Access tells me that I have a data type mismatch even though
both fields I am comparing are numbers. Access insists on putting the field
name in quotes. Does this change it to text? How do I keep this from
happening?


If it was put in quotes, it will be treated as text and then
you get that error. This usually happens when you mistype
the field name, but you can force the issue by placing [ ]
around the name in the criteria:

<> [PropertyAddress]
 

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

Back
Top