Thank you once again.
I have imported the Calendar table, the queries and the module which is now
called Module 2 as I already have Module 1.
I am not an expert at Access and am in above my head.
Where would I put the coding that you sent me - SELECT a.Product_Nbr???
And how does it work with the original code I had in the query
START DATE: DateAdd("d",-[LEAD TIME DAYS],[SHIP DATE])
Thank you.
You never furnished a query; you merely furnished a column from
query design view.
Where you see: START DATE: DateAdd("d",-[LEAD TIME DAYS],[SHIP
DATE])
Substitute this: (it is all one line)
Start Date: (SELECT c.calendar_date FROM Calendar AS c WHERE
c.work_day = 1 AND c.holiday = 0 AND c.calendar_date < [a.Ship
Date] AND c.calendar_date >= DATEADD("d",-(([a.Lead Time Days]
* 2) + 14),[a.Ship Date]) AND [a.Lead Time Days] = (SELECT
COUNT(* ) FROM Calendar c2 WHERE c2.calendar_date < [a.Ship
Date] AND c2.calendar_date >= .calendar_date AND c2.work_day
= 1 AND c.holiday = 0))
In other words I substituted a subquery for your DateAdd
expression. The value of Start Date is now determined by the
subquery.
All that is needed for your query to work now is the calendar
table.