I have a group of accounts and each account has a number of charges associated with it. Each charge has a post date. I want a report that groups charge details by account. The caveat is I only want accounts that have had a charge posted within the last 90 days. However, each account group would have the entire charge history associated with it (including charges over 90 days old).
In SQL, I would use the following statement:
SELECT account_id, charge_total, charge_description, charge_post_date
FROM account INNER JOIN charge ON account.account_id = charge.account_id
WHERE account_id = (SELECT account_id FROM account INNER JOIN charge ON account.account_id = charge.account_id WHERE max(charge_post_date) > dateadd(day,-90,getdate())
Any tips on how to get this result in Crystal?
In SQL, I would use the following statement:
SELECT account_id, charge_total, charge_description, charge_post_date
FROM account INNER JOIN charge ON account.account_id = charge.account_id
WHERE account_id = (SELECT account_id FROM account INNER JOIN charge ON account.account_id = charge.account_id WHERE max(charge_post_date) > dateadd(day,-90,getdate())
Any tips on how to get this result in Crystal?