I want to find values in a field called Invoice# that are not duplicates where field Ctrans# is a duplicate. These fields are both in table tblCtransPickups. Any help?
Something like this ?
SELECT A.[Ctrans#], A.[INVOICE#]
FROM tblCtransPickups A INNER JOIN
(SELECT [Ctrans#] FROM tblCtransPickups
GROUP BY [Ctrans#] HAVING Count(*) > 1) B
ON A.[Ctrans#] = B.[Ctrans#]
GROUP BY A.[Ctrans#], A.[INVOICE#]
HAVING Count(*) = 1;
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
I don't understand where I would put this query expression. I'm in the select query design view, and there is only one table to be queried for this information. What does the INNER JOIN do?
SELECT A.[CtransID], A.[INVOICE#] FROM tblCtransPickups A INNER JOIN (SELECT [CtransID] FROM tblCtransPickups GROUP BY [CtransID] HAVING Count(*) > 1) B ON A.[CtransID] = B.[CtransID] GROUP BY A.[CtransID], A.[INVOICE#] HAVING Count(*) = 1;
I've created a tblCtransPickups Table with CtransID and INVOICE# fields as long, created a query with copy'n'paste of your previous post and runned it without any error.
I'm using ac2003 in ac2k compatibility mode.
You may consider create a saved query with the subquery's select statement and use it's name in the join clause.
BTW ac2k with which SP or SR ?
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Changed Invoice# to Text, recreate the query and still no error (as expected).
Have you tried the saved query work around ?
My question about the ac2k patching version isn't naive as original versions of office 2000 apps are known to be severely bugged.
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.