I have a problem with the mtd and ytd formula in a select query. Basically I use the following forumula to calculate these the month and ytd totals. However the formula turns the negative numbers to positive which gives eronious results. I tried to take the Absolute reference out but this only serves to make all the values negative. Is there some way to tweek this formula to produce valid month and ytd calculations?
YTDActual: Abs(Sum((Year([Period])=2010 And Month([Period])>=7)*[Net Value]))
MTDActual: Abs(Sum((Year([Period])=2010 And Month([Period])=Month(forms!switch!cboMth))*[Net Value]))
This is what the SQL looks like if this helps further.
CODE
SELECT ResponsibleCC, Abs(Sum((Year([Period])=2010 And Month([Period])=Month(forms!switch!cboMth))*[Net Value])) AS MTDActual, Abs(Sum((Year([Period])=2010 And Month([Period])>=7)*[Net Value])) AS YTDActual
FROM qryCapWorks
WHERE (((Period) Between #7/1/2010# And [forms]![switch]![cboMth]))
GROUP BY ResponsibleCC;
FROM qryCapWorks
WHERE (((Period) Between #7/1/2010# And [forms]![switch]![cboMth]))
GROUP BY ResponsibleCC;
Would appreciate any push in the right direction on this problem.
Take care
Chad
Õ¿Õ