Quote Originally Posted by virolay View Post
Obviously, the fourth period is between two different days.
Just use OR instead of AND.

For simplicity, IF you were only using the Hours.
Code:
IF (RTChour >= 6)  AND (RTChour < 10) then INperiod_1
IF (RTChour >= 10) AND (RTChour < 14) then INperiod_2
IF (RTChour >= 14) AND (RTChour < 22) then INperiod_3
IF (RTChour >= 22) OR  (RTChour < 6)  then INperiod_4
HTH,