Union Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a whole series of Union queries and there is one that just does not
work and it is structured like all of the ones that do work. I can't find
the problem.


SELECT [QA_MiniMASS(8)FIN Hist 2].HierarchyLevel, [QA_MiniMASS(8)FIN Hist
2].BankID, [QA_MiniMASS(8)FIN Hist 2].ClientName, [QA_MiniMASS(8)FIN Hist
2].Match, [QA_MiniMASS(8)FIN Hist 2].[Count]
FROM [QA_MiniMASS(8)FIN Hist 2]




UNION



SELECT [QA_MiniMASS(8)FIN Hist 2_AgentLevel].HierarchyLevel,
[QA_MiniMASS(8)FIN Hist 2_AgentLevel].BankID, [QA_MiniMASS(8)FIN Hist
2_AgentLevel].ClientName, [QA_MiniMASS(8)FIN Hist 2_AgentLevel].Match,
[QA_MiniMASS(8)FIN Hist 2_AgentLevel].[Count]
FROM [QA_MiniMASS(8)FIN Hist 2_AgentLevel];


I keep getting an error message that states that [QA_MiniMASS(8)FIN Hist
2_AgentLevel].[Count] could refer to more than table refered to in the from
clause.

I only have one table in each from clause so I don't understand why I am
getting this message.

Thanks for any help with this.


--
Billy Rogers

Dallas,TX

Currently Using Office 2000
 
I found a way to get it to work. I just used select * instead of listing the
fields. I still don't understand why it didn't work.


--
Billy Rogers

Dallas,TX

Currently Using Office 2000
 
BillyRogers said:
I found a way to get it to work. I just used select * instead of listing the
fields. I still don't understand why it didn't work.


Might be because Count is an SQL function. Try changing the
field name to something else.
 
I thought of that too, but it works in the eleven other union queries that I
did. They all had a field named count.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000
 
BillyRogers said:
I thought of that too, but it works in the eleven other union queries that I
did. They all had a field named count.


Is [QA_MiniMASS(8)FIN Hist 2] a query with two fields named
Count? If so you need to alias one of them.

Beyond that wild guess, I can't imagine why you're getting
the message.
 
Back
Top