Hello everyone,
I have the following problem, which I haven't been able to solve for weeks. Basically, I want to do a Count with a dynamic condition on a date, which is not possible in the Count field settings.
I have three linked tables:
- 1 table A "Contracts" with insurance contracts. It has an anniversary date field.
- 1 table B "Vehicles" linked to table A for vehicles attached to insurance contracts. It includes two fields with a date of entry into the fleet, and a date of exit from the fleet.
- 1 table C "Annual periods" is linked to table A contracts. It contains the annual entry and exit periods created from the contract anniversary date.
What I want to do is obtain from table B "Vehicles" to table C "Annual periods" a count of the number of vehicles:
- 1 - on the entry date,
- 2 - on the period exit date.
The calculation of the count in table C from table B is normally quite straightforward: starting from (for example) the entry date, the count of the number of vehicles is :
(Date of entry into the fleet < date of entry into the period
AND
(Date of exit from fleet is zero OR Date of exit from fleet is > date of entry into period))
What do you think?
Many thanks in advance!
Erwan

