Joining on subqueries
Posted: 11 Nov 2012, 10:35
I need to add the date of the last communication with a customer to an aged debtors report. Of course if I use a regular join to the contact_history table for this I end up duplicating the financial records by the number of communication events.
Using regular SQL this could be done with a subquery; something like:
INNER JOIN (SELECT refn, max(contact_date) FROM contact_history GROUP BY refn) last ON sales_ledger.account_ref = last.refn
Is it possible to achieve something similar in Report Designer?
Using regular SQL this could be done with a subquery; something like:
INNER JOIN (SELECT refn, max(contact_date) FROM contact_history GROUP BY refn) last ON sales_ledger.account_ref = last.refn
Is it possible to achieve something similar in Report Designer?