let ( [
dtt = getastimestamp ( "1/24/2016 2:29 PM" ) // enter your field instead of what's in quotes
; tim = getastime ( dtt )
tim > getastime ( "23:00" )
; tim > getastime ( "15:00" )
; tim > getastime ( "06:30" )
Alternately, you could make a table of shifts, with a name, start and end time. Then relate a time field (getastime of your timestamp) such that "time >= begin" and "time <= end". Then the related shift record would have the name you need, with the added benefit that you could set up those records as something an administrative end user could edit.
tim = getastime ( dtt )
Some call me ... Tim?
I too avoid using reserved words within Let() functions. dat tim and ts usually.
Yeah, I know. It just struck me as funny (if you’re a Monty Python fan).
Shirley, you can't be serious!
I am serious. And don’t call me Shirley …
Do you want to be called Loretta? It's your right you know...
Fair point and apologies to Loretta. Apologies to all for going off at a tangent on this thread, but hey, Filemaker is fun and so is this forum!
BTW - what has Filemaker ever done for us... apart from...
How would I modify the case function in the calculation to identify events between 1700 and 0000?
(I was going to create another calculation field that just shows the text "extra" when the timestamp field contains a time in that range.)
The case function is essentially working from the end of the day to the beginning, so if you wanted everything after 1700 to be "extra", you'd put that first.
The case function essentially stops on the first match.
Thus, in the function provided, anything after 2300 is "night". For the second condition, I can check for after 1500 because if the time was also after 2300, I already got a result and stopped.