I'm writing a query and I'm getting a syntax error but I'm not seeing it
when I look at it and the error message isn't telling me where it is at. For
starters, does anyone see my mistake, and better yet does anyone know of a
bug hunting software that will give better details as to where the bug is?
My query:
SELECT First([First Name]) AS [Family First Name],
First([Last Name]) AS [Family Last Name],
[Matchfield],
First([Weld Co ID]) AS [Family Address ID]
FROM [PrimaryVoterTier]
GROUP BY [Matchfield]
HAVING (((Count(*))=1));
UNION SELECT
First([First Name]) & " and " Last([First Name]) AS [Family First Name],
First([Last Name]) AS [Family Last Name],
[Matchfield],
First([Weld Co ID]) AS [Family Address ID]
FROM [PrimaryVoterTier]
GROUP BY [Matchfield]
HAVING (((Count(*)=2));
UNION SELECT
"The " & First([Last Name]) & " Family" AS [Family First Name],
" " AS [Family Last Name],
[Matchfield],
First([Weld Co ID]) AS [Family Address ID]
FROM [PrimaryVoterTier]
GROUP BY [Matchfield]
HAVING (((Count(*)>2));
Jeff Boyce - 17 Jul 2006 21:58 GMT
Do each of the separate queries within the union work correctly? Confirm
this first, then assemble those back together.
Regards
Jeff Boyce
Microsoft Office/Access MVP
> I'm writing a query and I'm getting a syntax error but I'm not seeing it
> when I look at it and the error message isn't telling me where it is at.
[quoted text clipped - 38 lines]
>
> HAVING (((Count(*)>2));
Gary Walter - 17 Jul 2006 22:27 GMT
one thing:
the ";" are not allowed before the UNION's
--> delete them
"In need of assistance"wrote:
> I'm writing a query and I'm getting a syntax error but I'm not seeing it
> when I look at it and the error message isn't telling me where it is at.
[quoted text clipped - 38 lines]
>
> HAVING (((Count(*)>2));