Please! How can I add these 2 amounts? [message #10236] |
Fri, 09 January 2004 10:56 |
Susan Gipson
Messages: 4 Registered: December 2003
|
Junior Member |
|
|
For a view, I want to add the sum of all a person's contributions in a fisc. year and the sum of all of his/her spouse's contributions for that year (their contribution records are separate, under their own individual IDs). I need the total for each year, whether they both made contributions that year or not - it is very possible that one may have given during the year but the other did not.
Table: Gift-History
ID
Fisc Year
Gift Amt
I can link a person's ID to the spouse's ID through the Cross_Ref table.
Table: Cross-ref
ID
Code = 'SP' (for spouse)
Cross-ref ID
I have messed with this until I can't see straight. Any help would be greatly appreciated.
Susan
|
|
|
|
|
Re: Please! How can I add these 2 amounts? [message #10239 is a reply to message #10236] |
Fri, 09 January 2004 13:06 |
sverch
Messages: 582 Registered: December 2000
|
Senior Member |
|
|
Susan,
I have to run and cannot write a query for you right now, but I think you can build inline views (SELECT FROM (SELECT... for "prime contributor"), (select... for spouse )) and in the main query compute contributions A and B. If you have reference id it should not be hard...
Anyway, it is always easier to help when people sent sample data and desired result...
|
|
|