Below is my calculation field 'Time':
if DATEPART('hour',[CreateTime]) >=17 AND DATEPART('hour',[CreateTime]) <19 then "17~19peak"
elseif DATEPART('hour',[CreateTime]) >=15 AND DATEPART('hour',[CreateTime]) <17 then '15~17'
elseif DATEPART('hour',[CreateTime]) >=19 AND DATEPART('hour',[CreateTime]) <21 then '19~21'
else 'other hour'
end
I drag a field called 'workornot', so if our employees are working at that time, it will show 1.
What I want to do is I want to know if our employees work in peak hour, but I am not sure how to set the calculation field of this one. Thanks
If '17~19 peak'=1 and '15~17'=1 and '19~21'=1 Then 'full day'
elseif '17~19 peak'=1 and '15~17'=0 and '19~21'=0 Then 'peak hour only'
elseif '17~19 peak'=0 and '15~17'=1 and '19~21'=0 Then 'before peak hour'
elseif '17~19 peak'=0 and '15~17'=0 and '19~21'=1 Then 'after peak hour'
else 'not important'
end