union query

J

jmoore

I have a union query that was working fine, and other queries based on it
appear to be working fine. However, when I tried to open it today, a dialog
box is asking for a parameter value, Query1.CNTYNAME. There are no
parameters and I have searched the code and am not able to identify anything
that was changed for the query to stop working. I've listed the code below
in case that helps. Why can't I open the query now? Thanks!

SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1a" as Question, [A1a]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1b" as Question, [A1b]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A2" as Question, [A2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A3" as Question, [A3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A4" as Question, [A4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5a" as Question, [A5a]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5b" as Question, [A5b]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5c" as Question, [A5c]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A6" as Question, [A6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A7" as Question, [A7]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B1" as Question, [B1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B2" as Question, [B2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B3" as Question, [B3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B4" as Question, [B4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B5" as Question, [B5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B6" as Question, [B6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C1" as Question, [C1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C2" as Question, [C2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C3" as Question, [C3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C4" as Question, [C4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C5" as Question, [C5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C6" as Question, [C6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C7" as Question, [C7]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1a" as Question, [D1a]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1b" as Question, [D1b]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1c" as Question, [D1c]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D2" as Question, [D2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D3" as Question, [D3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D4" as Question, [D4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D5" as Question, [D5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E1" as Question, [E1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E2" as Question, [E2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E3" as Question, [E3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E4" as Question, [E4]
as Answer
FROM [qReview Sample];
 
K

KARL DEWEY

You have fields from two tables -
[2007 Sample].CNTYNAME
[tReview].ReviewKey

but only one table, and it does not match those in select part, in the
from part.

FROM [qReview Sample]

So how did it work before?

jmoore said:
I have a union query that was working fine, and other queries based on it
appear to be working fine. However, when I tried to open it today, a dialog
box is asking for a parameter value, Query1.CNTYNAME. There are no
parameters and I have searched the code and am not able to identify anything
that was changed for the query to stop working. I've listed the code below
in case that helps. Why can't I open the query now? Thanks!

SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1a" as Question, [A1a]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1b" as Question, [A1b]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A2" as Question, [A2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A3" as Question, [A3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A4" as Question, [A4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5a" as Question, [A5a]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5b" as Question, [A5b]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5c" as Question, [A5c]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A6" as Question, [A6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A7" as Question, [A7]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B1" as Question, [B1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B2" as Question, [B2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B3" as Question, [B3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B4" as Question, [B4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B5" as Question, [B5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B6" as Question, [B6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C1" as Question, [C1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C2" as Question, [C2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C3" as Question, [C3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C4" as Question, [C4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C5" as Question, [C5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C6" as Question, [C6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C7" as Question, [C7]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1a" as Question, [D1a]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1b" as Question, [D1b]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1c" as Question, [D1c]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D2" as Question, [D2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D3" as Question, [D3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D4" as Question, [D4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D5" as Question, [D5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E1" as Question, [E1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E2" as Question, [E2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E3" as Question, [E3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E4" as Question, [E4]
as Answer
FROM [qReview Sample];
 
J

jmoore

Both tables, 2007Sample and tReview are in the query, qReview Sample. And a
crosstab query based on this union query opens without any message. I copied
the union query code into another test database and I do not receive an
error. If I click on OK in the error dialog box, the query opens with the
correct results, but I don't think I should leave it that way. I appreciate
any other suggestions for correcting this.

Thanks!

KARL DEWEY said:
You have fields from two tables -
[2007 Sample].CNTYNAME
[tReview].ReviewKey

but only one table, and it does not match those in select part, in the
from part.

FROM [qReview Sample]

So how did it work before?

jmoore said:
I have a union query that was working fine, and other queries based on it
appear to be working fine. However, when I tried to open it today, a dialog
box is asking for a parameter value, Query1.CNTYNAME. There are no
parameters and I have searched the code and am not able to identify anything
that was changed for the query to stop working. I've listed the code below
in case that helps. Why can't I open the query now? Thanks!

SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1a" as Question, [A1a]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1b" as Question, [A1b]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A2" as Question, [A2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A3" as Question, [A3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A4" as Question, [A4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5a" as Question, [A5a]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5b" as Question, [A5b]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5c" as Question, [A5c]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A6" as Question, [A6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A7" as Question, [A7]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B1" as Question, [B1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B2" as Question, [B2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B3" as Question, [B3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B4" as Question, [B4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B5" as Question, [B5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B6" as Question, [B6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C1" as Question, [C1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C2" as Question, [C2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C3" as Question, [C3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C4" as Question, [C4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C5" as Question, [C5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C6" as Question, [C6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C7" as Question, [C7]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1a" as Question, [D1a]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1b" as Question, [D1b]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1c" as Question, [D1c]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D2" as Question, [D2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D3" as Question, [D3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D4" as Question, [D4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D5" as Question, [D5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E1" as Question, [E1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E2" as Question, [E2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E3" as Question, [E3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E4" as Question, [E4]
as Answer
FROM [qReview Sample];
 
K

KARL DEWEY

This is something new to me.
My queries always lose the prior table/query identiy and pickup the current
query name like this --

SELECT [qReview Sample].CNTYNAME, [qReview Sample].ReviewKey, "A1a" as
Question, [A1a] as Answer
FROM [qReview Sample]
UNION ALL
.......

jmoore said:
Both tables, 2007Sample and tReview are in the query, qReview Sample. And a
crosstab query based on this union query opens without any message. I copied
the union query code into another test database and I do not receive an
error. If I click on OK in the error dialog box, the query opens with the
correct results, but I don't think I should leave it that way. I appreciate
any other suggestions for correcting this.

Thanks!

KARL DEWEY said:
You have fields from two tables -
[2007 Sample].CNTYNAME
[tReview].ReviewKey

but only one table, and it does not match those in select part, in the
from part.

FROM [qReview Sample]

So how did it work before?

jmoore said:
I have a union query that was working fine, and other queries based on it
appear to be working fine. However, when I tried to open it today, a dialog
box is asking for a parameter value, Query1.CNTYNAME. There are no
parameters and I have searched the code and am not able to identify anything
that was changed for the query to stop working. I've listed the code below
in case that helps. Why can't I open the query now? Thanks!

SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1a" as Question, [A1a]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1b" as Question, [A1b]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A2" as Question, [A2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A3" as Question, [A3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A4" as Question, [A4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5a" as Question, [A5a]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5b" as Question, [A5b]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5c" as Question, [A5c]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A6" as Question, [A6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A7" as Question, [A7]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B1" as Question, [B1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B2" as Question, [B2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B3" as Question, [B3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B4" as Question, [B4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B5" as Question, [B5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B6" as Question, [B6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C1" as Question, [C1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C2" as Question, [C2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C3" as Question, [C3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C4" as Question, [C4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C5" as Question, [C5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C6" as Question, [C6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C7" as Question, [C7]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1a" as Question, [D1a]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1b" as Question, [D1b]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1c" as Question, [D1c]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D2" as Question, [D2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D3" as Question, [D3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D4" as Question, [D4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D5" as Question, [D5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E1" as Question, [E1]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E2" as Question, [E2]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E3" as Question, [E3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E4" as Question, [E4]
as Answer
FROM [qReview Sample];
 
J

John Spencer MVP

The SQL you posted has semi-colon embedded in it where there should not be any
- you should be getting a syntax error. There should be at most ONE
truncating semi-colon at the very end of the query.

If you continue to get the message, I suggest you try copying the SQL
statement into a new query and see if that takes care of the problem.
Sometimes you may see a prompt like that if during development of the query
you used the sort buttons in datasheet view and saved the change to the
datasheet layout. The easiest way to get rid of this artifact is to copy the
sql into a new query and then save the new query over the existing query.

SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1a" as Question, [A1a]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A1b" as Question, [A1b]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A2" as Question, [A2]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A3" as Question, [A3]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A4" as Question, [A4]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5a" as Question, [A5a]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5b" as Question, [A5b]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A5c" as Question, [A5c]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A6" as Question, [A6]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "A7" as Question, [A7]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B1" as Question, [B1]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B2" as Question, [B2]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B3" as Question, [B3]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B4" as Question, [B4]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B5" as Question, [B5]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "B6" as Question, [B6]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C1" as Question, [C1]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C2" as Question, [C2]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C3" as Question, [C3]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C4" as Question, [C4]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C5" as Question, [C5]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C6" as Question, [C6]
as Answer
FROM [qReview Sample];
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "C7" as Question, [C7]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1a" as Question, [D1a]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1b" as Question, [D1b]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D1c" as Question, [D1c]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D2" as Question, [D2]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D3" as Question, [D3]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D4" as Question, [D4]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "D5" as Question, [D5]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E1" as Question, [E1]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E2" as Question, [E2]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E3" as Question, [E3]
as Answer
FROM [qReview Sample]
UNION ALL
SELECT [2007 Sample].CNTYNAME, [tReview].ReviewKey, "E4" as Question, [E4]
as Answer
FROM [qReview Sample]

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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