I'm using the Access query design view.
These are working as designed:
Query1: I calculate the date at age 21 using the date of birth field [DOB] with formula
Code:
DOB21: DateAdd("yyyy",21,[DOB])
. In the same query I calculate 30 days before DOB21 as
Code:
30DaysBeforeDOB21: DateAdd("d",-30,[DOB21])
. So far so good and the correct dates are in the results. fyi...both calculated date fields are formatted as Short Date in the query's field properties. The DOB field is formatted as Short Date in the table where it's stored.
Query2: I include the [30DaysBeforeDOB21] field from Query1 and add the criteria
Code:
Between #2/1/2023# And #2/8/2023#
. The results are correct.
This is not working:
My issue occurs when I try to add variable criteria for the [30DaysBeforeDOB21] field. When I use the criteria
Code:
Between [Begin Date] and [End Date]
and enter the dates in the prompts when the query is run, the results are incorrect. While the results come back in the date format, the results contain records that are not between the dates in the criteria.
Thanks for your advice.