• Access 2007 SP2 – Invalid Operation

    Author
    Topic
    #483448

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #1334073

      Can you tell us the SQL for the query? Without it, it’s not really clear what you are actually doing.

    • #1334394

      Could you post the queries?

      • #1334504

        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;
        
    Viewing 1 reply thread
    Reply To: Access 2007 SP2 – Invalid Operation

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: