Results 1 to 2 of 2
  1. #1
    kaledev is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    20

    Question "Group By" causes "ODBC--Call Failed" error

    I have the following query that works perfectly:



    Code:
    SELECT [Q02 AUSTELL L/E].[Report Dt], [Q02 AUSTELL L/E].Terminal, [Q02 AUSTELL L/E].[L/E], Count([Q02 AUSTELL L/E].[L/E]) AS [Total Onhand Units], [View All Allotments].Allowed, Forms!MAIN!STARTDATE AS [Min Report Dt], Forms!MAIN!ENDDATE AS [Max Report Dt]
    FROM [Q02 AUSTELL L/E] INNER JOIN [View All Allotments] ON [Q02 AUSTELL L/E].Terminal = [View All Allotments].TerminalName
    GROUP BY [Q02 AUSTELL L/E].[Report Dt], [Q02 AUSTELL L/E].Terminal, [Q02 AUSTELL L/E].[L/E], [View All Allotments].Allowed;
    I need to also group by the STARTDATE and ENDDATE fields in this query. When I add them in, as shown below, I get the error "ODBC--Call Failed". I am a bit confused about this one, any ideas? Just to let you know, the "View All Allotments" query is referencing a few SQL Server Linked tables inside of its query. But I don't see how these fields are causing a problem since they have nothing to do with it. Thanks!

    Code:
    SELECT [Q02 AUSTELL L/E].[Report Dt], [Q02 AUSTELL L/E].Terminal, [Q02 AUSTELL L/E].[L/E], Count([Q02 AUSTELL L/E].[L/E]) AS [Total Onhand Units], [View All Allotments].Allowed, Forms!MAIN!STARTDATE AS [Min Report Dt], Forms!MAIN!ENDDATE AS [Max Report Dt]
    FROM [Q02 AUSTELL L/E] INNER JOIN [View All Allotments] ON [Q02 AUSTELL L/E].Terminal = [View All Allotments].TerminalName
    GROUP BY [Q02 AUSTELL L/E].[Report Dt], [Q02 AUSTELL L/E].Terminal, [Q02 AUSTELL L/E].[L/E], [View All Allotments].Allowed, Forms!MAIN!STARTDATE, Forms!MAIN!ENDDATE;

  2. #2
    kaledev is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    20
    The only way I could temp fix this was to append [View All Allotments] to a local table first...then everything works. This is similar to the "Query too complex" error I was recieving and had to fix the same way...no clue at all why this is happening when dealing with linked SQL Server tables...

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

Similar Threads

  1. Replies: 7
    Last Post: 01-19-2011, 10:39 AM
  2. Replies: 0
    Last Post: 11-30-2010, 12:23 PM
  3. Replies: 3
    Last Post: 04-10-2010, 10:22 AM
  4. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM
  5. "Count" and "Countif" in Reports
    By JMantei in forum Reports
    Replies: 1
    Last Post: 06-20-2006, 02:20 PM

Posting Permissions

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