Hi folks,
I've got an issue I did solve couple of years ago already, but I can't remember how - the curse of doing it only once.
I've got 2 tables.
Table 1 - history - contains an integer and a date field. Duplicates allowed.
Table 2 - Map - contains an integer, 2 date fields and an additional field that is to be added in the query. Duplicates allowed.
Both tables are joined via the integer fields:
The intention is to get all lines from "history" and add the "DataToAdd" column from "Map" to it, though both tables contain duplicates for the join clause.
To get the correct one, the History.DateClosed must be inbetween of Map.DateStart and Map.DateEnd.
Additionally, Map.DateEnd can be empty/null - I guess using Nz() here with Now() as null clause.
My issue is, that I can't figure out the proper filtering in combination with Nz().
Here are some samples and the intended output:
Thanks in advance.