The space is input by the forum after 50 contiguous characters. You need to use code tags to get around that.
You need to research how DLookup works and how to write them.
DLookup can only return one value. When applying criteria, you're saying WHERE somefield contains somevalue. You can't say where somevalue lies between 2 values. If you do and it even works, it will return the first value it finds that satisfies both criteria. In your case, the logic being presented is that someDate lies somewhere within a set of records that satisfy other criteria specified.
So it may turn out that the problem is related to how dates are stored in your fields vs what you're asking for, and that has to do with your Regional Settings for dates. Regardless of how you format a date field, the value is stored as a decimal that corresponds to mm/dd/yyyy. When you start formatting dates in expressions using the Format function (which by the way, coerces a value to a string) you can run in to trouble. I say that because even if you sort that out here, I don't see the lookup working for the aforementioned reasons.
Last edited by Micron; 04-24-2020 at 07:43 AM.
Reason: clarification & correction
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.