invalid operation

G

Guest

Client is running a select query based on 2 queries. If she enters a specific
report number as criteria, the query will return that record. However, she
wants the query to return all the records - then she gets the error: invalid
operation.

Returns error:
SELECT [PR1 Sum].Output_rpt, [PR1 Sum].Output_date, [PR1 Sum].Output_ID,
[PR1 Sum].Output_Month, [PR1 Sum].Output_Wrapper, [PR1 Sum].UNIT, [PR1
Sum].[Sum Of Output_qty], [PR3 Sum].[Sum Of Mach_Hrs]
FROM [PR1 Sum] INNER JOIN [PR3 Sum] ON [PR1 Sum].Output_rpt = [PR3
Sum].Mach_Rpt;


Does not return error:
SELECT [PR1 Sum].Output_rpt, [PR1 Sum].Output_date, [PR1 Sum].Output_ID,
[PR1 Sum].Output_Month, [PR1 Sum].Output_Wrapper, [PR1 Sum].UNIT, [PR1
Sum].[Sum Of Output_qty], [PR3 Sum].[Sum Of Mach_Hrs]
FROM [PR1 Sum] INNER JOIN [PR3 Sum] ON [PR1 Sum].Output_rpt = [PR3
Sum].Mach_Rpt
WHERE ((([PR1 Sum].Output_rpt)="BB20940"));

Why does the 2nd one return an error?
 
M

Marshall Barton

maryj said:
Client is running a select query based on 2 queries. If she enters a specific
report number as criteria, the query will return that record. However, she
wants the query to return all the records - then she gets the error: invalid
operation.

Returns error:
SELECT [PR1 Sum].Output_rpt, [PR1 Sum].Output_date, [PR1 Sum].Output_ID,
[PR1 Sum].Output_Month, [PR1 Sum].Output_Wrapper, [PR1 Sum].UNIT, [PR1
Sum].[Sum Of Output_qty], [PR3 Sum].[Sum Of Mach_Hrs]
FROM [PR1 Sum] INNER JOIN [PR3 Sum] ON [PR1 Sum].Output_rpt = [PR3
Sum].Mach_Rpt;


Does not return error:
SELECT [PR1 Sum].Output_rpt, [PR1 Sum].Output_date, [PR1 Sum].Output_ID,
[PR1 Sum].Output_Month, [PR1 Sum].Output_Wrapper, [PR1 Sum].UNIT, [PR1
Sum].[Sum Of Output_qty], [PR3 Sum].[Sum Of Mach_Hrs]
FROM [PR1 Sum] INNER JOIN [PR3 Sum] ON [PR1 Sum].Output_rpt = [PR3
Sum].Mach_Rpt
WHERE ((([PR1 Sum].Output_rpt)="BB20940"));


How are you opening the report?

How have you arrranged for the client to specify the record
identifyier?
 
G

Guest

It's not a report - just a select query.
--
maryj


Marshall Barton said:
maryj said:
Client is running a select query based on 2 queries. If she enters a specific
report number as criteria, the query will return that record. However, she
wants the query to return all the records - then she gets the error: invalid
operation.

Returns error:
SELECT [PR1 Sum].Output_rpt, [PR1 Sum].Output_date, [PR1 Sum].Output_ID,
[PR1 Sum].Output_Month, [PR1 Sum].Output_Wrapper, [PR1 Sum].UNIT, [PR1
Sum].[Sum Of Output_qty], [PR3 Sum].[Sum Of Mach_Hrs]
FROM [PR1 Sum] INNER JOIN [PR3 Sum] ON [PR1 Sum].Output_rpt = [PR3
Sum].Mach_Rpt;


Does not return error:
SELECT [PR1 Sum].Output_rpt, [PR1 Sum].Output_date, [PR1 Sum].Output_ID,
[PR1 Sum].Output_Month, [PR1 Sum].Output_Wrapper, [PR1 Sum].UNIT, [PR1
Sum].[Sum Of Output_qty], [PR3 Sum].[Sum Of Mach_Hrs]
FROM [PR1 Sum] INNER JOIN [PR3 Sum] ON [PR1 Sum].Output_rpt = [PR3
Sum].Mach_Rpt
WHERE ((([PR1 Sum].Output_rpt)="BB20940"));


How are you opening the report?

How have you arrranged for the client to specify the record
identifyier?
 
M

Marshall Barton

maryj said:
It's not a report - just a select query.


How have you arrranged for the client to specify the record
identifyier?

What does the client specify to indicate all records are
desired? Your first query should provide all records
without an error.

Where/When are you getting the error?

The two queries you posted look identical except for that
second one has an innocuous WHERE clause, so I assume there
is something about the criteria, but I don't see how that
can cause an "invalid operation" error.

First, you said that the query runs fine for a single
"report", then you say that there is an error when you
specify a criteria for the Output_rpt field. This seems to
indicate that you get an error for a single "report", which
I thought you said runs ok.

I am having trouble figuring out what is being done
differently when you get an error and when you don't.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top