Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6890 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Try something like:

Let ( [

h = Hour ( EntryTime )

] ;

Case (

h < 9 ; "Night" ;

h < 12 ; "Morning" ;

h < 19 ; "Noon" ;

h < 23 ; "Evening" ;

"Night"

)

)

Posted (edited)

Sorry to Hijack the thread but I need a similar calc.

I have 2 time fields: StartTime and EndTime (both within the same day). I have a field ElapsedTime=(EndTime - StartTime).

I need to break up the elapsed time into 3 different fields:

NormalWorkHours = Time within 8:00 and 12:15; 13:00 and 17:00

DaytimeExtraHours= Time within 7:00 and 8:00; 17:00 and 19:00

NighttimeExtraHours= Time within 0:00 and 7:00; 19:00 and 24:00

So that if StartTime = 5:00 and EndTime = 20:00, Id get:

ElapsedTime = 14:15

NighttimeExtraHours = 2:00+1:00=3:00

DaytimeExtraHours = 1:00+2:00=3:00

NormalWorkHours = 4:15 + 4:00=8:15

I've been going nutz trying to figure this one out. Any help will be greatly appreciated.

Edited by Guest
Posted

Try this:

NighttimeExtraHours =

Let ( [

rangeStart = Time ( 0 ; 0 ; 0 ) ;

rangeEnd = Time ( 7 ; 0 ; 0 )

] ;

Max ( Min ( EndTime ; rangeEnd ) - Max ( StartTime ; rangeStart ) ; 0 )

)

+

Let ( [

rangeStart = Time ( 19 ; 0 ; 0 ) ;

rangeEnd = Time ( 24 ; 0 ; 0 )

] ;

Max ( Min ( EndTime ; rangeEnd ) - Max ( StartTime ; rangeStart ) ; 0 )

)

For the other two fields, juat replace the 4 range parameters.

This topic is 6890 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.