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 |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2000-10-27 : 17:01:48
|
Greg writes "Say I have a system that tracks grants that are linked to specific projects. The grants are automatically deposited in accounts each year but they carry different "matching" rates each time. A user can keep spending from past years until the grant is exhausted using the original match rate. So the system needs to keep track of what portion of the money came from which grant.
For instance I have a table of funds:
Fund_name Fiscal_yr Deposited Match a 1998 200,000 25% a 1999 200,000 55% a 2000 200,000 75%
and a table of transactions
Fund_name Fiscal_yr Spent Matched a 1998 100,000 25,000 a 1999 200,000 75,000 etc.
Can I create a SQL statement that will show that in 1998 I should match 25% of my 100,000 and then in 1999 the first 100,000 has the same 25% but the next 100,000 has a 50%?
FYI I'm developing on Oracle 8i (8.1.6) for use in ASP on IIS4" |
|
|
|
|