Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
select 
d.clientid,
client.commonname,
c.claimtype,
c.reasontype,
c.reason,
d.claimid,
d.disputeid,
c.customercontactdate,
d.acquirernetwork,
d.status,
d.disputeamount,
to_date(cb.performedondatetime),
cb.amount
from
dispute as d
join claim as c
on d.tenantid = c.tenantid and d.claimid = c.claimid
join tenant as tenant
on d.tenantid = tenant.tenantid
join client as client
on d.tenantid = client.tenantid and d.clientid = client.clientid
join recoveryaction as cb
on d.tenantid = cb.tenantid and d.disputeid = cb.disputeid and cb.actionname in ('Dispute Submitted', 'Rapid Dispute Resolution') and cb.cycle = '1' 
where 
cb.performedondatetime is not null -- only disputes with chargebacks 
where 
    d.tenantid = 'YOURTENANTIDHERE'
    AND chargebackdate=:daterange

...