Ah, right. Thanks for your reply. Saw these but I guess I should have mentioned in my original post that I'm not running FileMaker Pro Advanced and therefore not able to create custom functions. Wondering if it's still possible. Or simply time to upgrade.
The primary advantage to the custom function is that it is not limited in the distance between the start date and end date. (There is a fundamental limit, but it is very high.)
If the maximum number of dates you need isn't very high (e.g. 31 for an event lasting up to 1 month), and FileMaker Pro Advanced is not available, you could write a single calculation that returns the list of dates.
Here is an example of such a calculation to handle events that last up to 7 days. You can modify it for longer durations just by adding more lines in the same pattern.
[startDate = Date(3;1;2016);
endDate = Date(3;4;2016);
d = endDate - startDate
If(d>1; "¶" & GetAsDate(startDate+1);"") &
If(d>2; "¶" & GetAsDate(startDate+2);"") &
If(d>3; "¶" & GetAsDate(startDate+3);"") &
If(d>4; "¶" & GetAsDate(startDate+4);"") &
If(d>5; "¶" & GetAsDate(startDate+5);"") &
If(d>6; "¶" & GetAsDate(startDate+6);"") &
"¶" & endDate
The CustomList() function by Agnès Barouh does not require recursion and can be used as a regular calculation to generate an arbitrarily long list of dates.
To convert it to a non-Custom Function calculation, wrap it with a Let() and define the three parameter values as Let() variables.
Start = 1;
End = 25;
Function = "Date(3;1;2016) -1 + [n]"
... the full original CustomList() definition goes here
Evening. It is time to upgrade to Pro Advanced. It contains tools that a developer simply needs. The data viewer is one. In my first years of development I never used that. Now it is essential.
Custom functions, the debugger, copy/paste fields are essentials.
Are you going to be able to come to DevCon? Historically a copy of FileMaker Pro Advanced is given to every attendee.
For your question without Advanced, you could create a script that loops. begin the script with a variable called theDate and set it to your event start date. Then set each repetition in the loop. Each trip thru the loop, set a rep with the value of the variable, then add one day to your theDate variable. Exit this loop when this value in the variable is is greater than your end date.
Without advanced you can't see the variable incrementing but you will see the results
in the am I can provide a small demo
Thank you, Jeremy. I will give that a try
Variables are stored as text, so using GetAsDate (theDate)+ 1 is a good idea.
At the end if your loop:
Exit Loop If [ GetAsDate (theDate) > YourTable::YourEndDate.