Why is my union query asking me to enter a parameter value?

G

Guest

When I run the query below, it asks me to enter a parameter value for
TOC.source_name. TOC.[Source_name] is in the select statement and
Source_name is a field in the sub-query TOC, so I thought I had it covered.
Any idea why Access doesn't recognize it?

SELECT TOC.[Works_number], TOC.[Works_name], TOC.[Source_ name],
TOC.[TRI.Expr1], TOC.[OCS.Expr1], TOC.[Expr1], PAR.[Expr1]
FROM [TRI OCS CPA join] TOC LEFT JOIN [PAR3417 results vs detects by works]
PAR
ON TOC.[Works_number]=PAR.[Works_number]
UNION
SELECT TOC.[Works_number], TOC.[Works_name], TOC.[Source_ name],
TOC.[TRI.Expr1], TOC.[OCS.Expr1], TOC.[Expr1], PAR.[Expr1]
FROM [TRI OCS CPA join] TOC RIGHT JOIN [PAR3417 results vs detects by works]
PAR
ON TOC.[Works_number]=PAR.[Works_number];


Possibly relevant item:
The sub-query [TRI OCS CPA join] is itself the same kind of simulated full
join between two other queries.

Thanks,
Pat
 
G

Guest

it asks me to enter a parameter value for TOC.source_name.
In the SQL below you have TOC.[Source_ name] that has a space after the dash
but you say it prompts without a dash. Maybe that is your problem.

I never seen a join like you have ---
FROM [TRI OCS CPA join] TOC RIGHT JOIN [PAR3417 results vs detects by works]
PAR ON TOC.[Works_number]=PAR.[Works_number];
Can you explain a little?
 
G

Guest

Pat,

I thinik it is because you mistyped the field name in the query.

What you show in your query is [Source_ name], which contains a space
between the underscore and name.

What are you actually trying to accomplish with this query? It looks like
you might be trying to do a "Full outer join".

Dale
 
G

Guest

Karl, yep it was that extra space in the field name. I fixed it and it ran
fine.
In answer to your question, my query accomplishes a full outer join. Is
that what you were wondering about?

Thanks,
Pat

KARL DEWEY said:
In the SQL below you have TOC.[Source_ name] that has a space after the dash
but you say it prompts without a dash. Maybe that is your problem.

I never seen a join like you have ---
FROM [TRI OCS CPA join] TOC RIGHT JOIN [PAR3417 results vs detects by works]
PAR ON TOC.[Works_number]=PAR.[Works_number];
Can you explain a little?
--
KARL DEWEY
Build a little - Test a little


Pat said:
When I run the query below, it asks me to enter a parameter value for
TOC.source_name. TOC.[Source_name] is in the select statement and
Source_name is a field in the sub-query TOC, so I thought I had it covered.
Any idea why Access doesn't recognize it?

SELECT TOC.[Works_number], TOC.[Works_name], TOC.[Source_ name],
TOC.[TRI.Expr1], TOC.[OCS.Expr1], TOC.[Expr1], PAR.[Expr1]
FROM [TRI OCS CPA join] TOC LEFT JOIN [PAR3417 results vs detects by works]
PAR
ON TOC.[Works_number]=PAR.[Works_number]
UNION
SELECT TOC.[Works_number], TOC.[Works_name], TOC.[Source_ name],
TOC.[TRI.Expr1], TOC.[OCS.Expr1], TOC.[Expr1], PAR.[Expr1]
FROM [TRI OCS CPA join] TOC RIGHT JOIN [PAR3417 results vs detects by works]
PAR
ON TOC.[Works_number]=PAR.[Works_number];


Possibly relevant item:
The sub-query [TRI OCS CPA join] is itself the same kind of simulated full
join between two other queries.

Thanks,
Pat
 
G

Guest

Thanks Dale. Yes the extra space in the field name was the problem.
Yes, I'm doing a full outer join with this query.

Thanks,
Pat

Dale Fye said:
Pat,

I thinik it is because you mistyped the field name in the query.

What you show in your query is [Source_ name], which contains a space
between the underscore and name.

What are you actually trying to accomplish with this query? It looks like
you might be trying to do a "Full outer join".

Dale
--
Email address is not valid.
Please reply to newsgroup only.


Pat said:
When I run the query below, it asks me to enter a parameter value for
TOC.source_name. TOC.[Source_name] is in the select statement and
Source_name is a field in the sub-query TOC, so I thought I had it covered.
Any idea why Access doesn't recognize it?

SELECT TOC.[Works_number], TOC.[Works_name], TOC.[Source_ name],
TOC.[TRI.Expr1], TOC.[OCS.Expr1], TOC.[Expr1], PAR.[Expr1]
FROM [TRI OCS CPA join] TOC LEFT JOIN [PAR3417 results vs detects by works]
PAR
ON TOC.[Works_number]=PAR.[Works_number]
UNION
SELECT TOC.[Works_number], TOC.[Works_name], TOC.[Source_ name],
TOC.[TRI.Expr1], TOC.[OCS.Expr1], TOC.[Expr1], PAR.[Expr1]
FROM [TRI OCS CPA join] TOC RIGHT JOIN [PAR3417 results vs detects by works]
PAR
ON TOC.[Works_number]=PAR.[Works_number];


Possibly relevant item:
The sub-query [TRI OCS CPA join] is itself the same kind of simulated full
join between two other queries.

Thanks,
Pat
 

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