So I changed by control source:
=IIf([CTRLYEAR]=[First Year?],Sum([amount]))
What I'm attempting to do (and you might know an easier way) is show a
report with a two year comparison. So one column would show [first year?]
and the next column would show [second year?].
However, it's still adding both 2008 and 2009 figures. Sometimes it will
put the total in the first control source ([firstamount]) and sometimes in
the second control source ([secondamount])
I don't want to put the actual year in, because next year the first year
might be 2010 and then you can choose the second year as either 2008 or 2009.
hoping this makes sense,
margaret
Marshall Barton said:
margaret wrote:
I have a control source and I put this in:
=IIf([CTRLYEAR]="2009",Sum([tblSales.amount]))
I attempting to add only the tblSales.amount for 2009. However, it's also
adding the amount for other years.
If CtrlYear is a number type field, the 2009 should not have
quotes around it.
=Sum(IIf(CTRLYEAR=2009,amount,0))