Can a DSum utilize criteria outside the named domain

  • Thread starter Thread starter dvlander
  • Start date Start date
D

dvlander

If I am using a DSum in a report, can I use criteria from a calculated field
on the report itself?

For example, suppose I pull a sum of cost data from the named domain by a
date range and I would like to additionally restrict it to the exact Job
Number on the specific record on the report.

Is this possible? Any other suggestions?

Thx, Dale
 
It appears to ignore it. Here is the syntax:

=DSum("[inInvoiceAmount]","tblVendorInvoices","[inInvoiceDate] <=
#7/31/09#" And "[inAssignmentID] = [AssignmentID]")

AssignmentID is the control on my report.

Thx, Dale
 
It appears to ignore it. Here is the syntax:

=DSum("[inInvoiceAmount]","tblVendorInvoices","[inInvoiceDate] <=
#7/31/09#" And "[inAssignmentID] = [AssignmentID]")

AssignmentID is the control on my report.

Thx, Dale

Jeff Boyce said:
What happens when you try it?

Regards

Jeff Boyce
Microsoft Office/Access MVP

For one thing, this part of your syntax is incorrect.
V V
"[inInvoiceDate] <= #7/31/09#" And "[inAssignmentID] =
[AssignmentID]")

You have superflouous quotes after the # and before [AssignmentID].

Try:
"[inInvoiceDate] <= #7/31/09# And [inAssignmentID] =
[AssignmentID]")
 
Fred:

That solved it, thanks much for the assistance.

Dale

fredg said:
It appears to ignore it. Here is the syntax:

=DSum("[inInvoiceAmount]","tblVendorInvoices","[inInvoiceDate] <=
#7/31/09#" And "[inAssignmentID] = [AssignmentID]")

AssignmentID is the control on my report.

Thx, Dale

Jeff Boyce said:
What happens when you try it?

Regards

Jeff Boyce
Microsoft Office/Access MVP

If I am using a DSum in a report, can I use criteria from a calculated
field
on the report itself?

For example, suppose I pull a sum of cost data from the named domain by a
date range and I would like to additionally restrict it to the exact Job
Number on the specific record on the report.

Is this possible? Any other suggestions?

Thx, Dale

For one thing, this part of your syntax is incorrect.
V V
"[inInvoiceDate] <= #7/31/09#" And "[inAssignmentID] =
[AssignmentID]")

You have superflouous quotes after the # and before [AssignmentID].

Try:
"[inInvoiceDate] <= #7/31/09# And [inAssignmentID] =
[AssignmentID]")
 
Back
Top