Hi, all, has anyone had any luck using the NEXT_DA...
# general
a
Hi, all, has anyone had any luck using the NEXT_DAY expression in a saved search with a dynamically-generated "day-of-week" value? In other words, instead of passing a constant string value:
Copy code
NEXT_DAY({startdate}, 'MONDAY')
...have you succeeded in passing a variable in place of the constant? e.g.
Copy code
NEXT_DAY({startdate}, UPPER({custbody_target_day_of_week}))
I just cannot get it to accept anything but the constant string. Everything else is ERROR: Invalid Expression
k
isn’t the function supposed to tell you something like “if a start day is between tuesday 1/1/XXXX and sunday 1/5/XXXX it gives you next Monday date”? In other words, your ‘MONDAY’ is always charachter/CHAR, not dynamic. since there are only seven days in a week I would write some CASE WHEN expression listing all days and make it dynamic that way.
a
Yes, that's right. I tried going the CASE route, but for what I"m trying to accomplish it requires so many cases that I exceed the character limit for the formula. Conceptually, I'm simply trying to pass a generated string 'Monday' instead of typing the string literal 'Monday' directly into the formula -- but it seems to be unable to accept this.
k
has to be a weekday..