A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Reserved error (-3011)



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 07:15 AM
BobRoyAce
external usenet poster
 
Posts: n/a
Default 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  
Old May 25th, 2004, 12:05 PM
Gary Walter
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.