Hey folks, anyone able to provide some assistance? I'm still stuck on this issue.
I'm trying a new approach: create a date iteration (i.e. Jan 1, Jan 2, Jan 3) and for each day, determine if a specific Stay includes that date.
However, I'm getting errors with my date iteration formula.
I have a parameter, @DateRange, which is what it says. Note that it is a date variable.
I have a formula, @SelectedDate:
Global DateTimeVar SelectedDate := Minimum({?DateRange})
Yes, I realize this is a DateTime, I'll get back to that.
I have a second formula, @DateIteration:
Global DateTimeVar SelectedDate;
do
(SelectedDate := DateAdd("d",1,SelectedDate))
while
(SelectedDate < Maximum({?DateRange}));
SelectedDate
Thing 1: When I call these both a DateVar instead of a DateTimeVar, I get an error with the DateAdd formula, saying that the output needs to be a Date. No error with DateTime, so I guess that the DateAdd function is converting it to a DateTime?
Thing 2: I'm getting an error that "A loop was evaluated more than the maximum number of times allowed." Now, for my test, my daterange was only 5 days, so clearly something is going wrong.