Pledge Payment Received Date

I'm working on a pledge query for finance.  I'm able to find all of the components of the pledge and payments EXCEPT for the actual date that the payment was received.

The script I've developed for this is below.  Any suggestions would be greatly appreciated.  Thank you.

Clint Dawley
Dallas Zoo

SELECT c.lname, c.fname, a.ref_no, a.customer_no, CONVERT(DATE,b.due_dt) as date_due, CONVERT(DATE,a.cont_dt) as pledge_date, b.amt_due as pledge_payment_amount_due, b.amt_recd as pledge_payment_amount_received, CONVERT(DATE,b.due_dt) as pledge_payment_due_date,
d.description as pledge_status, CAST(a.recd_amt as money) as total_amount_received, CAST(a.cont_amt as money) as original_pledge_amount, a.cont_amt - a.recd_amt as pledge_balance,
g.description as campaign_description, h.description as appeal_description, i.description as fund_description, e.street1, e.street2, e.street3, e.city, e.state, LEFT(e.postal_code, 5) + '-' + RIGHT(e.postal_code,4) as postal_code, f.address as email



FROM T_CONTRIBUTION a

JOIN T_SCHEDULE b on a.ref_no = b.ref_no
JOIN T_CUSTOMER c on a.customer_no = c.customer_no
LEFT JOIN TR_PLEDGE_STATUS d on a.pledge_status = d.id
JOIN T_ADDRESS e on c.customer_no = e.customer_no and primary_ind = 'Y'
LEFT JOIN T_EADDRESS f on c.customer_no = f.customer_no and f.primary_ind = 'Y'
JOIN T_CAMPAIGN g on a.campaign_no = g.campaign_no
JOIN T_APPEAL h on a.appeal_no = h.appeal_no
JOIN T_FUND i on a.fund_no = i.fund_no

WHERE a.cont_type = 'P' and a.recd_amt <> a.cont_amt and a.campaign_no = 8

Parents Reply Children
No Data