In a related question, when I'm calculating the theoretical slot dates, we know that the due date will always be on a friday or a Tuesday. If I divide the number of days in a year by the number of expected orders, can I get the date to round up to the closest Friday or Tuesday date?
Let ( D = put your calculation for the next due date here ;
Case ( DayOfWeek ( D ) = 1 ; D + 2 ; //Sunday becomes next Tuesday subtract 2 if you want it to be preceding Friday
DayOfWeek ( D ) = 2 ; D + 1 ; // Monday becomes next Tuesday
DayOfWeek ( D ) = 3 ; D ; // Tuesday stays as Tuesday
DayOfWeek ( D ) = 4 ; D - 1 // Wednesday becomes preceding Tuesday
DayOfWeek ( D ) = 5 ; D + 1 // Thursday becomes next Friday
DayOfWeek ( D ) = 6 ; D // Friday stays as Friday
DayOfWeek ( D ) = 7 ; D - 1 // Saturday becomes preceding Friday
When matching the actual due date to your theoretical due date, is the date the only criteria or do you also need to match by some kind of customer ID?
I'm thinking that you could pull up all unfilled order records for a given customer--either in a portal or a found set and then sort them by due date so that the record with the oldest due date is the first record and this would be the record you want.
Thanks Phil, that did the trick!!