Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to something I think is simple; once again, the lack of useful documentation is tripping me up.
I have default dates set to load a document:
StartDate = MonthStart(today(),-1)
EndDate = MonthEnd(today(),-1)
These are fine for 90% of the time, but occasionally users want to run reports over different time periods. So, I tried this:
IF $(vUserSetDates) THEN
Let StartDate = Input('Enter Start Date (MM/DD/YYYY)', 'Input required');
Let EndDate = Input('Enter End Date (MM/DD/YYYY)', 'Input required');
ELSE
Let StartDate = MonthStart(Today(),-1);
Let EndDate = MonthEnd(Today(),-1);
END IF
where vUserSetDates is set to either "TRUE" or "FALSE" by a button on the sheet.
However, regardless of what vUserSetDates is, I get an error message, the input boxes ask me for start and end dates,
and then the dates are reset to the defaults anyway. In other words, all the commands execute and the "IF" structure is ignored.
According to the documentation, this is the correct way to structure an IF THEN ELSE statement. What am I missing?
Thanks in advance for your help.
Are you assigning string values like 'TRUE' and 'FALSE' to the variable?
Try using -1 and 0 instead, or
IF '$(vUserSetDates)' = 'TRUE' THEN
...
Are you assigning string values like 'TRUE' and 'FALSE' to the variable?
Try using -1 and 0 instead, or
IF '$(vUserSetDates)' = 'TRUE' THEN
...
Thanks my friend, that did the trick.