Hi all,

Working on a general ledger report and I came up with a pretty simple query.

SELECT gl_code.glcode_value,
    lookup_value.lookup_name AS fin_action,
    SUM(IF(debit_credit_flag = 0,posted_amount, 0.000)) AS debit,
    SUM(IF(debit_credit_flag = 1, posted_amount,0.000)) AS credit
FROM financial_trxn
INNER JOIN gl_code USING (glcode_id)
INNER JOIN financial_action ON financial_action.fin_action_id =
financial_trxn.fin_action_id
INNER JOIN lookup_value ON lookup_value.lookup_id =
financial_action.lookup_id
INNER JOIN account_trxn ON account_trxn.account_trxn_id =
financial_trxn.account_trxn_id
WHERE financial_trxn.action_date >= '2009-07-01'
    AND financial_trxn.action_date <= '2009-07-31'
GROUP BY glcode_value, fin_action
ORDER BY glcode_value, fin_action

My only question is why am I getting some values as negative and others not?
It doesn¹t seem consistent across the board.  Can anyone provide some
clarity?

This query should run just fine on most mifos instances (at least of build
1.2)

r
-- 
Ryan Whitney  
Mifos Technical Program Manager
[email protected]
Mifos - Technology that Empowers Microfinance (www.mifos.org) 

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Mifos-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-users

Reply via email to