G
Guest
I am trying to create a calculated control on a form using the DSum function.
The problem I am running into is when I try to limit the domain using the
criteria section of the DSum function. I have something like this:
=DSum("[Transaction]","tblUsage","[PaperType] = '35in 30/32lb'")
So far, everything is fine. But I would like to further restrict the
criteria to transactions that took place between certain dates and that is
where I think I am hitting the snag. It seems to me that I could use this:
=DSum("[Transaction]","tblUsage","[PaperType] = '35in 30/32lb' AND
[dtDate] Between Date() and DateAdd("d",-7,Date())")
That is, I want all transactions that involve 35in paper and occured between
today and a week ago. But I must have done something wrong because Access
doesn't like that statement. Did I make a typo or do I need some additional
punctuation in there?
Any help would be appreciated.
Steven Sutton
The problem I am running into is when I try to limit the domain using the
criteria section of the DSum function. I have something like this:
=DSum("[Transaction]","tblUsage","[PaperType] = '35in 30/32lb'")
So far, everything is fine. But I would like to further restrict the
criteria to transactions that took place between certain dates and that is
where I think I am hitting the snag. It seems to me that I could use this:
=DSum("[Transaction]","tblUsage","[PaperType] = '35in 30/32lb' AND
[dtDate] Between Date() and DateAdd("d",-7,Date())")
That is, I want all transactions that involve 35in paper and occured between
today and a week ago. But I must have done something wrong because Access
doesn't like that statement. Did I make a typo or do I need some additional
punctuation in there?
Any help would be appreciated.
Steven Sutton