Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    May 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MSQuery - how to compare fields

    I am using Excel 97 and MSQuery to compare 2 CSV files - a master file and a comparison file. I have a query developed in Access that I'd like to carry over to MSQuery and can't find the correct syntax to use.

    The query compares the value from a field in the Master CSV file with the same field in the Comparison CSV file, and should include rows when the contents of the Comparison field differ from that of the Master.
    ie. criteria should be: [Field_Table1] <> [Field_Table2]

    If anyone can help me work out the combination of curly, round, square brackets and single quote marks I'd be really grateful. I'm working in the Criteria rows inside MSQuery and can drag the "Master" field into a column, but for the life of me cannot work out how to enter the other field-name on the criteria line without getting a "Syntax Error".

    Thanks heaps

  2. #2
    New Lounger
    Join Date
    Apr 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSQuery - how to compare fields

    Hi

    Open your query in Access and on the view menu Choose SQL View. Copy the SQL statement (highlight Ctrl +C). Then go into Microsoft Query and switch it to View the SQL and Paste the SQL statement into it. When you switch back to view the grid you may get an error saying that the query cannot be displayed. That is alright as long as it is a valid SQL statement it should work.

    Hope that helps.

    Tom
    www.tblacklock.com

Posting Permissions

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