Hi, the query below will do it.
You can't actually link directly from account to prd_offering... you have to
go through loan_account (for loans) and savings_account (for savings).


select account.created_date,
customer.display_name,global_account_num,account.external_id,account_state.status_description,office.display_name,of.display_name,
savingsproduct.prd_offering_name, loanproduct.prd_offering_name
from account
join account_state on account.account_state_id =
account_state.account_state_id
join customer on account.customer_id = customer.customer_id
join office on account.office_id = office.office_id
join office of on office.parent_office_id = of.office_id
left join loan_account la on la.account_id = account.account_id
left join prd_offering loanproduct on loanproduct.prd_offering_id =
la.prd_offering_id
left join savings_account sa on sa.account_id = account.account_id
left join prd_offering savingsproduct on savingsproduct.prd_offering_id =
sa.prd_offering_id


John

On Tue, May 11, 2010 at 8:02 AM, Shekko <[email protected]>wrote:

> hi, people
>
> how can i retriev prd_offering.prd_offering_name, joining from
> account?, i don't see a clear way.
>
> i am building this report:
>
> select account.created_date,
>
> customer.display_name,global_account_num,account.external_id,account_state.status_description,office.display_name,of.display_name
> from account
> join account_state on account.account_state_id =
> account_state.account_state_id
> join customer on account.customer_id = customer.customer_id
> join office on account.office_id = office.office_id
> join office of on office.parent_office_id = of.office_id
>
>
> but i need to include prd_offering.prd_offering_name.
>
> thanks in advance.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Mifos-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mifos-users
>
------------------------------------------------------------------------------

_______________________________________________
Mifos-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-users

Reply via email to