Skip to Content
0
Jul 18, 2018 at 03:32 PM

Nested If Statement

45 Views Last edit Jul 18, 2018 at 04:53 PM 3 rev

Morning All,

Please I need help with writing the correct statement. I need to do a check on if APPNTMNT_DT = VISIT.INSP_DT then perform the no reach, late, on time statment.

Any help will greatly be appreciated alot!!!!

Code

if date({APPNTMNT_DT}) = date({VISIT.INSP_DT}) then

(IF ISNULL({INSPECT_TIME_IN}) = TRUE THEN "NO REACH"

elseif

time({INSPECT_TIME_IN}) >= time({APPNTMNT_DT}) and time({INSPECT_TIME_IN}) <= time({APPNTMNT_DT_END_TIME}) then

"ON TIME"

else if

time({INSPECT_TIME_IN}) < time({APPNTMNT_DT}) then "EARLY"

else if time({INSPECT_TIME_IN}) > time({APPNTMNT_DT}) then "LATE")

else "error"