I'm in need of some help with getting my duplicates from showing more than once in my output.
SELECT
accountNumber AS 'Member Number',
OD.orderdetails AS 'iNum',
FirstName AS 'First Name',
LastName AS 'Last Name',
HGP.email AS 'Email',
points AS 'Points -->',
'$' + CONVERT(varchar(50),(CONVERT(int,Points) * .1)) AS '<-- Amount',
CountryCode AS 'Country',
CONVERT(VARCHAR(10), issued, 101) AS 'Order Date',
CONVERT(VARCHAR(10), cs.RedeemedDate, 101) AS 'R Date'
FROM tblHGP HGP, OrderDetails OD, tblInvoices i
JOIN tblCS cs ON i.InvoiceNumber = cs.InvoiceNumber
JOIN tblECI ac ON i.InvoiceNumber = ac.InvoiceNumber
AND cs.Sold = ac.ECIID
WHERE
i.InvoiceNumber = HGP.invoiceNumber
AND HGP.issued BETWEEN '2010-01-01' AND '2010-09-01'
AND HGP.invoiceNumber = OD.orderdetails
ORDER BY
HGP.issued
Like i said above, i am getting duplicates on some of the users. I've tried the distinct but doesn't seem to work.
Any help would be great! :o)
David