Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Scott
Posting Yak Master
145 Posts |
Posted - 2000-11-18 : 08:05:23
|
| I have a table with ID, START, END & AMOUNT.I need to run a query, trigger or sp that will return each month with the % of the ammount allocated to that month depending on the start and end dates.eg: Project1, 15 Jan 2000, 13 March 2000, $20 000.00 Project2, 5 Feb 2000, 4 April 2000, 13 500.00Project1 duration in days = 59Cost per day = $20 000/59 = $338.98cost per month: Jan 17*338.98=$5762.66, Feb=$9830.42, Mar=$4406.74Therefore result set would be:Jan 2000 $5762.66Feb 2000 $15455.42March 2000 $11381.74April 2000 $900.00ie: All costs per month for all projects added together. |
|
|
|
|
|