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;