0

If/Then Time Statements

I am creating a button to determine if something was completed early, on time, or late.  

The fields I will be working with in this formula are: 'Quoted Completion' and 'Timeliness'

When the button is clicked, I want to update a dropdown named Timeliness. The options in Timeliness are Early (1), On Time (2) and Late (3).

My conditions are:

-if the completion time ( now() ) is less than 15 minutes to the Quoted Completion, I would like to mark Timeliness as Early (1).

-if the completion time ( now() ) is greater than 15 minutes or 1 minute before Quoted Completion, I would like to mark Timeliness as On Time (2)

-if the completion time ( now() is equal to or beyond the Quoted Completion time, I would like to mark Timeliness as Late (3)

 

I know I would need to use if then statements, but I am not sure how to do this entirely. 
 

5 replies

null
    • SMoore
    • 5 yrs ago
    • Reported - view

    Bump

    • SMoore
    • 5 yrs ago
    • Reported - view

    Does anyone have any suggestions for time if then statements?

    • Database Consultant
    • Kirkness_Associates_Ju
    • 5 yrs ago
    • Reported - view

    Try something like this:

    if Target - now() <= 0 then
        Timeliness := 3
    else
        if Target - now() < 900000 then
            Timeliness := 2
        else
            Timeliness := 1
        end
    end

    • SMoore
    • 5 yrs ago
    • Reported - view

    I am receiving an error. 

    • SMoore
    • 5 yrs ago
    • Reported - view

    Update, it actually worked! Thank you so much!

Content aside

  • 5 yrs agoLast active
  • 5Replies
  • 1503Views