AnsweredAssumed Answered

Script for time works fine…except for times between 06:00 and 10:00

Question asked by pauhana658 on Aug 29, 2014
Latest reply on Aug 30, 2014 by pauhana658

Title

Script for time works fine…except for times between 06:00 and 10:00

Post

     I have a script that automatically inserts a text value into a field based on the time of day. It works great, except for times between 6:00 and 10:00 in the morning. Here's the script. It runs when the layout is opened. Can anyone tell me why this is happening? Mine eyes be old and I may be missing a critical typo. The lines that don't work are the second and third in the script. All others work fine. Thanks!

      

           Set Period of Day

If [ Glucose::Period of Day="" ]
                    If [
Glucose::Time>="06:00" and Glucose::Time<"10:00" ]

Insert Text [ Glucose::Period of Day; “Before Breakfast” ]

End If
                    If [
Glucose::Time>="10:00" and Glucose::Time<"17:00" ]

Insert Text [ Glucose::Period of Day; “Before Lunch” ]

End If
                    If [
Glucose::Time>="17:00" and Glucose::Time<"23:00" ]

Insert Text [ Glucose::Period of Day; “Before Dinner” ]

End If
                    If [
Glucose::Time>="23:00" and Glucose::Time<"6:00" ]

Insert Text [ Glucose::Period of Day; “Early Morning” ]

End If

Go to Next Field

End If

page1image7760

      

Outcomes