Posted by russzee on 12/07/05 04:48
I have a table with the following columns
---------------------------------------------
Payment Payment_Date
--------------------------------------------
900 5/15/05
900 615/05
900 7/15/05
900 8/15/05
900 9/15/05
-------------------------------------------
I also have a predetermined value @total = 3600
I need to write a SQL query where it returns the Payment_Date as soon
as SUM(Payment) > 3600.
So , in this case the returned result would be 9/15/05
I know I can do this via cursors but i was wondering if there is a sql
query which can accomplish this.
TIA
- Mr. Z
[Back to original message]
|