with InvDups as (select INVOICEID from CustInvoiceJour
where CustInvoiceJour.DATAAREAID = 'JWC'
group by INVOICEID having (count(INVOICEID) > 1))
select InvDups.INVOICEID, SALESID, CREATEDDATETIME, CREATEDBY from InvDups
join CustInvoiceJour on CustInvoiceJour.INVOICEID = InvDups.INVOICEID
Order by InvDups.INVOICEID, CREATEDDATETIME