=DSUM negates criteria in query

S

Scott B

Greetings,

I acidentally posted this in the Forms forum by mistake, so please excuse
the error. I have a report that summarizes sales and produces a sales tax
summary. I need to report non-taxable sales and taxable sales seperately
and calculate tax on taxable sales. I have a =DSUM expression in the rpeort
that works,b ut it broke the criteria to define dates in the query. Jeris
the =DSUM statement: =DSum("[RoomTotal]","[qrySalesTax]","[TaxExempt] =
False"). Any one have an idea why the criteria does not work? The criteria
is part of a date field called StartDate. The criteria is: Between [Type a
Beginning Date] AND [Type an Ending Date]. The query, criteira nd report all
worked before the appearance of the =DSUM expression.

Thanks,
Scott
 
D

Duane Hookom

What do you mean by "it broke the criteria to define dates in the query"?
What criteria and how did it break it?

Do you want to Sum the RoomTotal field values in the report where TaxExempt
is False? If so, use:
=Sum(Abs([TaxExempt]=0) * [RoomTotal])
 
S

Scott B

Duane,

I mean that I get an #ERROR on the Report from the =DSUM with the criteria
in the query and do not get it when the criteria is not there. But that is
mute since the expression you provided just worked perfectly. I have never
used Abs before, but it fit the bill here.

Many thanks,
Scott B

Duane Hookom said:
What do you mean by "it broke the criteria to define dates in the query"?
What criteria and how did it break it?

Do you want to Sum the RoomTotal field values in the report where
TaxExempt is False? If so, use:
=Sum(Abs([TaxExempt]=0) * [RoomTotal])

--
Duane Hookom
MS Access MVP


Scott B said:
Greetings,

I acidentally posted this in the Forms forum by mistake, so please excuse
the error. I have a report that summarizes sales and produces a sales
tax summary. I need to report non-taxable sales and taxable sales
seperately and calculate tax on taxable sales. I have a =DSUM expression
in the rpeort that works,b ut it broke the criteria to define dates in
the query. Jeris the =DSUM statement:
=DSum("[RoomTotal]","[qrySalesTax]","[TaxExempt] = False"). Any one have
an idea why the criteria does not work? The criteria is part of a date
field called StartDate. The criteria is: Between [Type a Beginning Date]
AND [Type an Ending Date]. The query, criteira nd report all worked
before the appearance of the =DSUM expression.

Thanks,
Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top