0
|
anhuihaiwei2005Lv4见习互助发布于2020-5-26 11:47
|
参考下面公式来写:如果是星期一,返回字符串“星期一”,否则执行greparray。
IF(WEEKDAY()=0,'星期一','GREPARRAY(
ARRAY("07:00-09:00","09:00-11:00","11:00-14:00","14:00-16:00","16:00-19:00","夜班"),
IF(DAY($DATES) = DAY(NOW()),
AND(Hour(NOW())-mid(item,7,2) < 2 , Hour(NOW()) - mid(item,7,2) > -1),
IF(Hour(NOW()) < 12,item = "夜班", item = "")
)
)')
|
-
history(提问者)
- IF(WEEKDAY(\'${dates}\')=2,\'夜班\',GREPARRAY(
ARRAY(\"07:00-09:00\",\"09:00-11:00\",\"11:00-14:00\",\"14:00-16:00\",\"16:00-19:00\",\"夜班\"),
IF(DAY(\'${dates}\') = DAY(NOW()),
AND(Hour(NOW())-mid(item,7,2) < 2 , Hour(NOW()) - mid(item,7,2) > -1),
IF(Hour(NOW()) < 12,item = \"夜班\", item = \"\")
)
))
我写成这样,前面$dates参数无论选择什么都是只带出夜班
|
|