I want to use a mechanism where entries for shift A and Shift B are allowed between specific time of the day
Shift A entries to be allowed between 10am to 9pm
Shift B entries to be allowed between 11pm to 9am
Date for Shift B should be of the previous day if entries are being made after 12am
To achieve this I’m using the following expression in date
ifs(
AND([Shift]="Shift A",TIMENOW()>Time("10:00:00"),TIMENOW()<=Time("21:00:00")),Today(),
AND([Shift]="Shift A",TIMENOW()>Time("21:00:00"),TIMENOW()<=Time("10:00:00")),"-NA-",
AND([Shift]="Shift B",TIMENOW()>Time("23:00:00")),TODAY(),
AND([Shift]="Shift B",TIMENOW()<=Time("09:00:00")),(Today()-1),
AND([Shift]="Shift B",TIMENOW()>Time("09:00:00"),TIMENOW()<=Time("23:00:00")),"-NA-"
)
along with validation on date as
OR(
[Date]=Today(),
[Date]=Today()-1,
[Date]<>"-NA-"
)
I feel the above should work perfectly but somehow the expression does’t seem to be working. If the part of the expression for Shift B alone is used, the Shift B dates are being calculated as expected. But part of the expression for Shift A, is not giving the desired result.
Request if someone can validation the above expression pls.