# How to calculate a total based on year to date?

Question asked by DanielRich on Dec 28, 2010
Latest reply on Dec 29, 2010 by philmodjunk

### Title

How to calculate a total based on year to date?

### Post

Filemaker Pro Pals:

Hmm. Just can't figure out how to do this. I have two tables linked by ID. So, in table 1 I have a portal to table 2. Now, what I am doing is tracking clients for a non-profit who donate money. So Client A donates money on a particular date, and then donates again on another date. I want to have a calculated field that shows the total money donated. That part is easy by using the sum function. But, I want to track it by current calendar year. So, say the client donates money last year, and now this year. I want the calculated field to show up for this year only. How do I structure this? There are two fields involved in the calculation: One is the date of transaction, and the other is the amount. I tried using the case function, but I just can't figure out how to do it. Any thoughts here?