Domain aggregate multiple criteria

  • Thread starter Multiple selection criteria in dsum
  • Start date
M

Multiple selection criteria in dsum

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.
 
M

Marshall Barton

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)")
 
S

Sue

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)")
 
Top