I don’t know your structure so I go very wide.
Drop what you can’t use or take several items together.
Anyway, try this first in a file you make just to test and understand this technique before you use it in your application.
Make a valuelist with all the days of the week going from 1 to 7 and put this as checkbox on a layout in a field you create for that (weekDays), where 1 is for Sunday and 7 for Saturday and the rest for the days in between.
Make fields:
startDate – date
endDate - date
Go to create Custom Function (I don’t have FM 9, so I don’t know yet if they changed the access way – in FM 8.5 it is File -> Define -> Custom Function)
Create a new CF, name it ‘WeekDayRange’ with parameters:
startDate
endDate
weekdays
make the calculation:
Case (
startDate and not IsEmpty ( FilterValues ( DayOfWeek ( startDate ) ; weekDays ) ) ;
startDate & ¶
)
&
Case (
startDate < endDate ;
WeekDaysRange ( startDate + 1 ; endDate ; weekDays )
)
Create an other calc field daysInRange, result text:
WeekDayRange (startDate ; endDate ; weekDays )and put this on your layout. Here you will see the result.
Take the 'WeekdayRange' from the list of function in the calculationbox.
In Browse Mode:
Fill in a date in startDate and endDate and check all the days of the week in your checkboxfield if you want all the weekdays between the two given days.
If you want only from Monday to Friday, uncheck Saturday and Sunday etc.
What it does.
Gives a ¶ separated list of the dates between the initial dates for the given days in the weekdays field.
This field is a ¶ separated numberlist of chosen days because it's a checkbox field.
The list will be sorted by date.
This field you can use in a relationship or you can parse out each date in separate field if you need.
HTH