I have a table [DateToFrom], with three fields [ID],[DateFrom] and [DateTo].
I have a table [Teas] with two fields [ID] and [Date].
I wanted to count the number of records in the table [Teas] between two dates, and show the result on a report.
I created a report [TeasReport] with it's source table [DateToFrom] and I put the fields [DateFrom] and [DateTo] in the report header.
I then put a text box in the report [TeasReport] footer and defined it's source as :-
This worked well for total records but I needed the criteria between dates.
And so, playing around, I tried :-
This worked very well, and I was happy - until I read the Microsoft help document on the DCount function, which states quite clearly " Any field that is included in criteria must also be a field in domain"
My syntax, which works well, seems to go against this rule as :-
As I say, this is working well, but given that it seems to go against the rules can anyone advise if anything might come out of the woodwork to bite me later on ?
I have a table [Teas] with two fields [ID] and [Date].
I wanted to count the number of records in the table [Teas] between two dates, and show the result on a report.
I created a report [TeasReport] with it's source table [DateToFrom] and I put the fields [DateFrom] and [DateTo] in the report header.
I then put a text box in the report [TeasReport] footer and defined it's source as :-
=DCount("[ID],"Teas","[ID]>0")
This worked well for total records but I needed the criteria between dates.
And so, playing around, I tried :-
=DCount("[ID],"Teas","[Date]Between[DateFrom]and[DateTo]")
This worked very well, and I was happy - until I read the Microsoft help document on the DCount function, which states quite clearly " Any field that is included in criteria must also be a field in domain"
My syntax, which works well, seems to go against this rule as :-
"Teas" is the domain name
[Date] is a field within the "Teas" domain
But :-[Date] is a field within the "Teas" domain
[DateFrom] and [DateTo] which I have included in the criteria are fields in the report source table, but are not within the "teas" domain.
As I say, this is working well, but given that it seems to go against the rules can anyone advise if anything might come out of the woodwork to bite me later on ?