3 Replies Latest reply on Feb 6, 2010 8:16 AM by isaaccs

# The simple but elusive Time Filter

### Title

The simple but elusive Time Filter

### Post

Hi. This seems simple enough but I can't figure it and at this point fear I'm over thinking it.

I'm seeking a function or calculation (explained) that, given:

filterStartTime

filterEndTime

startTime

endTime

returns the quantity of hours/time present between the start time and the end time within the filter range.

So, for example, in a timesheet, we are only looking for 'overtime' hours worked between 1 am and 6 am...

filterStartTime = 1:00am

filterEndTime = 6:00am

employeeStartTime =  12:30am

employeeEndTime = 11:00am

This function would return 5 hours (the time between the filter values).

Any thoughts/functions/insights that anyone has used?

• ###### 1. Re: The simple but elusive Time Filter

View this Google "filemaker time calculations"

There is something here - I am just unwilling to search further.

I think it was a Dwayne Blog entry or multiple entrys.

• ###### 2. Re: The simple but elusive Time Filter

Couldn't it be something like:

Case (starttime <= filterStartTime and endTime >= filterEndTime ; filterEndTime - filterStartTime ;

endTime > filterEndtime and starttime >= filterStartTime and starttime < filterendtime ; filterendTime -  starttime;

starttime <= filterStarttime and endtime < filterEndTime and endtime > filterStarttime ; starttime - filterstarttime)

??

• ###### 3. Re: The simple but elusive Time Filter

Thanks for your thoughts gentlemen. Someone was able to give me this simple but effective calculation over on fmforums, I provide it here for the record:

Max Min RangeEnd EndTime ) - Max RangeStart StartTime ) ; )