Results 1 to 9 of 9
  1. #1
    samanthaM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    25

    Custom Query Help

    Im attempting to write a query that runs through the whole database and checks the "Owner_Address" and "Situs_Address" fields. When the Owner Address and Situs Address contain the same information, no record is returned by the query, when there is a mismatch a record should be returned.

    If Owner_Address & Situs_Address match, then nothing should be returned by the query
    For example:


    Owner Address: 123 Main Street Situs Address:123 Main Street
    This would not return a record because Owner address and Situs Address are the same.

    The query should only return mismatches between Owner Address and Situs Address.
    For Example:
    Owner Address: PO Box 341 Situs Address: 345 Green Hill
    This would return a record because there is a mismatch between owner address & Situs address

    Click image for larger version. 

Name:	return.jpg 
Views:	16 
Size:	56.7 KB 
ID:	9855

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Are these two fields in the same table or in different tables.

  3. #3
    samanthaM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    25
    These fields are in the same table.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Select Owner_address
    , Situs_Address
    FROM
    YOUR_TABLE_NAME
    WHERE
    [Owner_address] <>Situs_Address;

    (untested)

  5. #5
    samanthaM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    25
    Quote Originally Posted by orange View Post
    Select Owner_address
    , Situs_Address
    FROM
    YOUR_TABLE_NAME
    WHERE
    [Owner_address] <>Situs_Address;

    (untested)
    Pardon my ignorance Orange, but where does this query information get entered? I don't see the options such as "FROM" or "WHERE" in query design view.

    Thank you.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Go to query wizard--> SQL View -> and paste it in. Then Run or ! (the big exclamation point)

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    If you are just learning Access and you have Acc2010, there is a series of free videos that might be helpful to you.

    First is http://www.youtube.com/watch?v=pHiOX...eature=related
    You can get to the others from this one.

  8. #8
    samanthaM is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Posts
    25
    @Orange, thanks it works great! Also thanks for the videos, thanks again for helping me.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Custom Query field
    By yeleek in forum Queries
    Replies: 3
    Last Post: 06-07-2012, 07:58 AM
  2. Replies: 4
    Last Post: 05-21-2012, 04:09 PM
  3. Create Custom box before executing query
    By mailinsiddu in forum Access
    Replies: 1
    Last Post: 01-09-2012, 11:14 AM
  4. Custom Date in Query
    By frdebelo in forum Queries
    Replies: 4
    Last Post: 09-22-2011, 07:01 AM
  5. Replies: 2
    Last Post: 08-05-2010, 09:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums