Hello, SQL 2000
I have the following (note this had been moved from Access)
My question is why the difference in returned records when the GROUP BY clause is changed? If I use just TracNum I get a different result than when I use all three.
I can sort of see why PRecd would be different but the CName throws me. And yes Aname% has several variations.
Thank you,
djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
I have the following (note this had been moved from Access)
Code:
SELECT P.TracNum
, MAX(P.[PDate]) AS [MaxOfPDate]
, MIN(P.[PRecd]) AS [PRecd]
FROM Table1 A
INNER JOIN Table2 P
ON A.TracNum = P.TracNum
GROUP BY P.TracNum, A.[CName], P.[PRecd]
HAVING A.[CName] Like 'Aname%' AND P.[PRecd] Is Not Null
My question is why the difference in returned records when the GROUP BY clause is changed? If I use just TracNum I get a different result than when I use all three.
I can sort of see why PRecd would be different but the CName throws me. And yes Aname% has several variations.
Thank you,
djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!