[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting AR reports from the past





On Jan 30, 2008 12:39 PM, The Anarcat <..hidden..> wrote:
Just replying to myself already:

This is where I'm at now:

koumbit-ls=# SELECT cu.name, a.invnumber, SUM(a.amount), SUM(c.amount)
FROM ar a JOIN customer cu ON (a.customer_id = cu.id) JOIN acc_trans c
ON c.trans_id = a.id  WHERE c.chart_id=10004 AND c.amount > 0 AND
c.transdate <= '2007-08-31' AND a.transdate <= '2007-08-31' GROUP BY
a.invnumber,cu.name  HAVING SUM(c.amount) <> SUM(a.amount) ORDER BY
cu.name;

(which basically "works")

You may also want to take a look at the AR Outstanding report for the same day.  It is certainly not elegant but it may work for you.

 Best Wishes,
Chris Travers