Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Access 2007 SP2 - Invalid Operation

    I'm running the simplest of queries (honest) but am getting Invalid Operation every time I run it.
    1 query and 1 table.
    I run the query with 1 query and it works fine
    Run it with both and invalid operation

    I changed the original query to make a table and used the table instead of the query, linked the 2 tables and it worked without error.
    Using the original query and it shows invalid operation.

  2. #2
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Can you tell us the SQL for the query? Without it, it's not really clear what you are actually doing.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Could you post the queries?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks Guys, the sql was very basic where 1 query was linked on one to one join with another query based on a text field.
    One of those queries that you take down to a single field and it still didn't work.
    The answer - Index the linked field in the audit query.

    SQL below resulted in an invalid operation
    Code:
    SELECT [Find duplicates for dbo_TimesheetsB].Timesheet_Number, 
    qry_Timesheets_Audit.Row_Id
    FROM 
    qry_Timesheets_Audit RIGHT JOIN [Find duplicates for dbo_TimesheetsB] ON qry_Timesheets_Audit.Row_Id = [Find duplicates for dbo_TimesheetsB].Timesheet_Number;

    the SQL below works without error - exactly same SQL
    Code:
    SELECT [Find duplicates for dbo_TimesheetsB].Timesheet_Number, 
    qry_Timesheets_Audit.Row_Id
    FROM 
    qry_Timesheets_Audit RIGHT JOIN [Find duplicates for dbo_TimesheetsB] ON qry_Timesheets_Audit.Row_Id = [Find duplicates for dbo_TimesheetsB].Timesheet_Number;

Posting Permissions

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