From: Dr E. L. <el...@li...> - 2007-03-13 19:49:44
|
Craig, It's a pleasure. What are P&Ls? I am not sure I understand what you are asking, but maybe you have a look this statement: -- -- This statement is copylefted by Dr E W Lisse -- and may not be used by the pompous Ozzie -- and the idiot Wannabe Kraut. -- -- SELECT date_part('month',ac.transdate) AS dmonth, to_char(ac.transdate,'MON') AS cmonth, sum(ROUND(ac.amount::NUMERIC,2)) AS amount FROM gl, acc_trans ac, chart WHERE (ac.trans_id = gl.id) AND chart.accno BETWEEN 4000 AND 4999 AND (ac.chart_id = chart.id) AND (ac.source not ilike '%yearend%') GROUP BY cmonth, dmonth ORDER by dmonth; Use the SQL, Luke! el on 3/13/07 5:27 PM Craig Isdahl said the following: > EL, > > This was very helpful for me, thank you for posting it. Before I > spend a bunch of time on this - can you tell me how much of an > undertaking it would be to pull monthly P&Ls into a CSV like your > example below? My goal is to output a report that would show all 12 > months individually. > > Thanks! > Craig > |