0

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

null
    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Something with: while weekday(Date) != text(Days) do  Date := Date + 1 end

    this is not tested, it might need some tweaking... 

    Steven

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    while weekdayName(weekday(Date)) != ....

    • Merika
    • 3 yrs ago
    • Reported - view

    Thanks Steven, I'm going to try and work that out. Let's see what it brings

    • Merika
    • 3 yrs ago
    • Reported - view

    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?

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    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
    end

    end;
    d

    My choice field contains Monday,Tuesday,Wednesday,....

    I've put the above code in a formula field to see the result of c .

    Steven

    • Merika
    • 3 yrs ago
    • Reported - view

    Thanks Steve, I'll try that out today!

Content aside

  • 3 yrs agoLast active
  • 6Replies
  • 532Views