If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Reserved error (-3011)
I inherited a database and need to make some changes to some queries. The
table and field names are crazy (include spaces, etc.), but I have nothing to do with that. So, the issue is that when I modified a query to get what's shown below, and I attempt to execute it, I get the following error message: Reserved error (-3011); there is no message for this error. All I did was add the ORDER BY clause. Without that the query runs but I get records back in wrong order. What is wrong with this query? ------- QUERY BEGINS ------- SELECT TableA.[Month Name], (100*(TableB.[SumOfTotal Production]/TableB.[SumOfTotal Capacity])) AS Efficiency FROM TableA INNER JOIN (MonthData INNER JOIN TableB ON MonthData.[System Month Number] = TableB.[System Month Number]) ON TableA.[Month Order] = MonthData.[Fiscal Month Number] GROUP BY TableA.[Month Name], (100*([SumOfTotal Production]/[SumOfTotal Capacity])), TableB.[Fiscal Year] HAVING TableB.[Fiscal Year]=2004 ORDER BY MonthData.[Fiscal Month Number] ------- QUERY ENDS ------- |
#2
|
|||
|
|||
Reserved error (-3011)
"BobRoyAce" wrote I inherited a database and need to make some changes to some queries. The table and field names are crazy (include spaces, etc.), but I have nothing to do with that. So, the issue is that when I modified a query to get what's shown below, and I attempt to execute it, I get the following error message: Reserved error (-3011); there is no message for this error. All I did was add the ORDER BY clause. Without that the query runs but I get records back in wrong order. What is wrong with this query? ------- QUERY BEGINS ------- SELECT TableA.[Month Name], (100*(TableB.[SumOfTotal Production]/TableB.[SumOfTotal Capacity])) AS Efficiency FROM TableA INNER JOIN (MonthData INNER JOIN TableB ON MonthData.[System Month Number] = TableB.[System Month Number]) ON TableA.[Month Order] = MonthData.[Fiscal Month Number] GROUP BY TableA.[Month Name], (100*([SumOfTotal Production]/[SumOfTotal Capacity])), TableB.[Fiscal Year] HAVING TableB.[Fiscal Year]=2004 ORDER BY MonthData.[Fiscal Month Number] ------- QUERY ENDS ------- Hi Bob, Best guess: When you create a group with your 3 current selections, in each group, will [Fiscal Month Number] be distinct? It makes sense to me that they would be, but it wouldn't hurt to check. Add it twice to the grid and set one to MAX and other to MIN. If they are the same, then keep one and sort on it and see if you still get error. Just guessing, Gary Walter |
Thread Tools | |
Display Modes | |
|
|