DSum Criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a large table with a field (Mon_SO) with values of 0 or 1. There is a
row for each week number. What I would like is to sum the Mon_SO field for
the previous 3 weeks only - something like:

CSO: DSum("[MonSO] ","Table1"," [Table1]![Week] <="& ([Queries]![Query2]!
[Week]-3))

But I think the syntax is wrong. I keep getting an error message saying that
"Microsoft Access can't find the name [Queries]!.....
The end result to look like
Week, Mon_SO, CSO
1,1,1
2,1,2
3,1,3
4,0,2
5,0,1

Thanks in anticipation.
 
I think that I have solved it using a sub-query:
CSO: (Select Sum(MonSO) from Table1 Where [WeekN] Between [Emp1].[WeekN]
and( [Emp1].[WeekN]-2);)

Though am happy to hear of any better solutions
 
Back
Top