How to display a date based on a choice field
I have a multiple choice field that contains the name of weekdays called Days. I am looking for a solution to update the date field (Date) with the next time a Day is Monday or Tuesday and so on, which should be updated every day. I thought a simple if then statement could work but I can't seem to get it right. As I'm new to Ninox, I have no clue on how to get this to work
6 replies
-
Something with: while weekday(Date) != text(Days) do Date := Date + 1 end
this is not tested, it might need some tweaking...
Steven
-
while weekdayName(weekday(Date)) != ....
-
Thanks Steven, I'm going to try and work that out. Let's see what it brings
-
I'm stuck... most probably also because when I read my question I think I haven't explained well enough. My multiple-choice field is called Days and the values one can select are Monday, Tuesday, and so on. If I apply the solution above, I'm not getting any date returned. I think I might have to define somewhere that my choices are as "days of week" to make it work but am not sure. Any more hints for me to puzzle further?
-
Is it a choice field or a multiple choice field? How would it return one date with a multiple choice field if more can be selected....
This works for me with a choice field:
let d := Date;
if Days then
while weekdayName(weekday(d)) != text(Days) do
d := d + 1
endend;
dMy choice field contains Monday,Tuesday,Wednesday,....
I've put the above code in a formula field to see the result of c .
Steven
-
Thanks Steve, I'll try that out today!
Content aside
- 4 yrs agoLast active
- 6Replies
- 533Views