Domain aggregate multiple criteria

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

Guest

I am having problems with the syntax when trying to use multiple criteria in
dsum or dlookup. I am trying to state dates between say form1![start] and
form1[end] and form1[company]. I also sometimes want ot choose dates NOT
between start to end.

Could anyone please help, or point me in the right direction.
 
Multiple selection criteria in dsum" said:
I am having problems with the syntax when trying to use multiple criteria in
dsum or dlookup. I am trying to state dates between say form1![start] and
form1[end] and form1[company]. I also sometimes want ot choose dates NOT
between start to end.


You can separate the criteria with AND or OR.

I think this might be something like what you want:

DLookup("[field]", "table", "[Company] = Forms!form1.company
AND [datefield] BETWEEN Forms!form1.startdate And
Forms!form1.enddate")

or

DLookup("[field]", "table", "[Company] = Forms!form1.company
AND NOT ([datefield] BETWEEN Forms!form1.startdate And
Forms!form1.enddate)")
 
Thanks Marshall. That worked a treat.

Marshall Barton said:
Multiple selection criteria in dsum" said:
I am having problems with the syntax when trying to use multiple criteria in
dsum or dlookup. I am trying to state dates between say form1![start] and
form1[end] and form1[company]. I also sometimes want ot choose dates NOT
between start to end.


You can separate the criteria with AND or OR.

I think this might be something like what you want:

DLookup("[field]", "table", "[Company] = Forms!form1.company
AND [datefield] BETWEEN Forms!form1.startdate And
Forms!form1.enddate")

or

DLookup("[field]", "table", "[Company] = Forms!form1.company
AND NOT ([datefield] BETWEEN Forms!form1.startdate And
Forms!form1.enddate)")
 
Back
Top