Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008

    Unanswered: Tricky How To - Deposit Forecasting

    I need some help with the last part of a script to forecast deposits for our company.

    I have a sql statement and php script that gathers the average days to pay invoices for each of our customers and the customer code, invoice amount, and invoice date of all of our open invoices. By combining the two on each open invoice, I hope to be able to guesstimate the day each open invoice will be paid (using the customer on that invoice's previous avg days to pay).

    I can gather the info fine so far, but what I am left with is a dollar amount of the invoice and an estimated pay date. I want to summarize by day, the total amount of dollars on invoices that will be paid.

    My data now looks like so...

    ProbableDatePaid Amount
    01/01/09 500.00
    01/10/09 200.00
    01/01/09 600.00
    01/02/09 500.00
    01/10/09 500.00

    and I need it to be like so...

    01/01/09 1100.00
    01/02/09 500.00
    01/03/09 0.00
    01/04/09 0.00
    ... ...
    01/10/09 700.00

    Can anyone help with this or point me in a direction?


  2. #2
    Join Date
    Sep 2008

    sorry - figured it out

    Nevermind I figured it out

    I summarized in the sql instead of the php much easier that way!

  3. #3
    Join Date
    Mar 2007
    For those interested i suspect the resolution was to use a GROUP BY sql clause to group by date, and then SUM(Amount) to add up all the grouped items.

  4. #4
    Join Date
    Sep 2008
    It was exactly that. thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts