Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2012
    Posts
    4

    Unanswered: Data Matching Query Question

    Hi I am pretty much a complete noob using access so if my questions are incomplete or not clear please let me know and I'll do my best to clarify and get you what you need.

    I'm using access 2003

    Situation:
    I have a multiple column access DB that I am trying to run one column against another to see if the data contained in column B is different than Column E is the same/similar or different.

    Goal:
    I want to output all records that colum B & Colum E are different to another database with the same structure as the original.

    Example:
    The records have columns for site address (B) and mailing address (E), I want the records with different site & mailing addresses placed in a new data base.

    How do I do this?


    Thanks in advance for any help

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Is it colum B & Colum E in database A different form colum B & Colum E in database B, or is it column B different from column E in the same database? As I (try to) understand it, what you expose under Goal seems to be contradictory towards what you explain under Example.
    Have a nice day!

  3. #3
    Join Date
    Sep 2012
    Posts
    4
    Quote Originally Posted by Sinndho View Post
    Is it colum B & Colum E in database A different form colum B & Colum E in database B, or is it column B different from column E in the same database? .
    Columns B & E are different columns in the same database.

    In both the example & the goal I want to be able to compare data from different columns in the same database and select the records that are different based on the comparing columns B & E and those records go in to the new database.

    Does this help clarify??

    Thanks

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can compare the contents of 2 columns in the same table and retrieve the rows where both columns do not contains the same data like this:
    Code:
    SELECT SomeTable.* 
    FROM SomeTable LEFT JOIN (SELECT Column1, Column2 FROM SomeTable) AS a
    ON SomeTable.Column1 = a.Column2
    WHERE SomeTable.Column1 IS NULL;
    The Access SQL syntax to insert data into another Access database is:
    Code:
    INSERT INTO TableName ( Column1, Column2, ...) IN 'Full path to the external database'
    SELECT SomeTable.Column1, SomeTable.Column2, ...)
    FROM SomeTable
    WHERE Condition;
    Have a nice day!

  5. #5
    Join Date
    Sep 2012
    Posts
    4
    Thank You.

    I'll try and figure out how to apply this and make it work.

    Thanks again for helping me out.

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •