From: Craig I. <cr...@da...> - 2007-03-13 22:55:44
|
P&L = Profit & Loss (i.e. Income Statement) I'll give this a try later tonight or tomorrow and let you know how it goes... Craig > -----Original Message----- > From: sql...@li... [mailto:sql-ledger- > use...@li...] On Behalf Of Dr Eberhard Lisse > Sent: Tuesday, March 13, 2007 3:50 PM > To: sql...@li... > Subject: Re: [SL] Output reports to csv > > 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 > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > sql-ledger-users mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sql-ledger-users |