0

Date format in formula

I am trying to set up a multiple conditional if statement.  Having trouble figuring out how to put a date for the script to check against.  Here is my code.

 

if 'Lead Student Type' = 2 and 'Enrolled Date' < date(10012023) then
    number('Enrolled Days') * number(33.333333333333336)
else
    if 'Lead Student Type' = 2 and 'Enrolled Date' > date(10012023) then
        number('Enrolled Days') * number(29.761904761904763)
    else
        if 'Lead Student Type' = 3 or 'Lead Student Type' = 4 then
            number('Enrolled Days') * number(35.357142857142854)
        end
    end
end

Also, I always seem to have difficulty doing multiple if statements.  Every time I try with any field I am doing it on, it only seems to pull up just 2 conditions and nothing beyond 2.  So, in the above instance, I want it to multiply a number against the amount of enrolled days, however to apply it 3 different ways.  The first, Lead Student Type=2 and Enrolled Date being before 10/01/2023, second, Lead Student Type=2 and Enrolled Date being after 10/01/2023, and third Lead Student Type being 3 or 4. 

2 replies

null
    • Fred
    • 10 mths ago
    • Reported - view

    check out the Ninox doc on date(), you will see the proper date format of date(year, month, day).

      • Dave_Irving
      • 10 mths ago
      • Reported - view

      Thanks, using date(year, month, day) in the formula fixed it!

Content aside

  • Status Answered
  • 10 mths agoLast active
  • 2Replies
  • 58Views
  • 2 Following