We are trying to return the last top 9 records for a specific customer but don't want duplicate dates. Problem is that we need to order descending on and id field so that makes it not distinct. Here is our current code.
SELECT Top 9
tblohb_Customer,
tblohb_InvoiceDate,
tblohb_Facility
FROM tbl_OrderHeaderBilled
WHERE tblohb_Facility = '01' AND
@CustNum = tblohb_Customer
ORDER BY tblohb_ID DESC
Thanks,
Joe
SELECT Top 9
tblohb_Customer,
tblohb_InvoiceDate,
tblohb_Facility
FROM tbl_OrderHeaderBilled
WHERE tblohb_Facility = '01' AND
@CustNum = tblohb_Customer
ORDER BY tblohb_ID DESC
Thanks,
Joe