SELECT BM.PUser,
BM.Desc, BM.Price,
BM.Info,
CAST (CASE
WHEN BI.Closed = 'E' then BQ.Qty-BQ.Consign-(SUM(BD.QtySold))
ELSE BQ.Qty-BQ.Consign
END as int) as Stock
FROM BINVOICE BI
, BDETAIL BD
, BQTY BQ
, BMASTER BM
WHERE (BD.User = BI.User)
AND
(BQ.PartNo = BD.PartNo)
AND
(BQ.PartNo = BM.PartNo)
AND
(BM.Price > 0.01)
AND
(BM.Active = 'Y')
GROUP BY BM.PUser, BM.Price,
BM.Desc, BM.Info,
BQ.Consign, BQ.Qty,
BI.Closed
My issue is that I want only one of each PUser to display, but some of them appear multiple times. I believe the CASE I have made is where they are coming from. I am not quite sure how to get around this. Using SELECT DISTINCT did not work for me. Any guidance would be greatly appreciated. It is used on NexusDB.