In the below, I'm counting orders with multiple product lines in table Temp. In table TEMP, there will be duped invoice numbers indicating multiple lines. When there's >1, no problem. When there's <=1, I can only get a return of NULL. I'm trying to display a value of 0 for both columns. What am I doing wrong?
Code:
SELECT Nz([Temp]![InvNo],0) AS InvNo, Nz(Count([Temp]![InvNo]),0) AS InvNoCount
FROM Temp
GROUP BY Nz([Temp]![InvNo],0)
HAVING (((Nz(Count([Temp]![InvNo]),0))>1))
ORDER BY Nz([Temp]![InvNo],0), Nz(Count([Temp]![InvNo]),0);
Thanks!