I\'ll try to explain my requirement, hoping someone can assist on this.
We have a table that contains payment records, basically containing an order ID, the date, the