dbTalk Databases Forums  

File Maker Time Calculations

comp.databases.filemaker comp.databases.filemaker


Discuss File Maker Time Calculations in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
EMTMark@gmail.com
 
Posts: n/a

Default File Maker Time Calculations - 01-01-2007 , 11:51 PM






Hello, I am trying to calculate an elapsed time for hours volunteered
per shift at a volunteer ambulance corp.

When a member comes in, they would sign in, they would input their name
and the time they arrived. (Start Time)
When a member finishes his/her tour, they note the time they are done.
(End Time)

I need to be able to calculate the amount of time that person was
volunteering for that specific shift.
We use 24:00 format for all times.
Some members may come in at 22:00 and leave at 05:00, that presents a
calculation problem becasue its spanned accross 2 different dates.
Althought its one 24 hour period for the tour.

Ultimatley I will need this information to print out a report on how
many hours that member volunteered per month.


Does anyone have any ideas on how to perform this time calculation?


Reply With Quote
  #2  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: File Maker Time Calculations - 01-02-2007 , 12:27 AM






The main thing to remember is that Dates are represented in FM in days, and
Times in seconds.
Then as there are 86400 seconds per day, one could, I suppose, pretty easily
make the formula in mixing StartDate (as number) and Start Time (as number)
in one hand and EndDay and EndTime on another hand and substract the first
from the second to get the result in seconds. A 'Case' test should first
start to see if EndDate is equal to Startdate.
Sorry of not giving a completely finished answer as serious guys usually do.
Remi-Noel

<EMTMark (AT) gmail (DOT) com> a écrit dans le message de news:
1167717101.047997.90160 (AT) 42g2000...oglegroups.com...
Quote:
Hello, I am trying to calculate an elapsed time for hours volunteered
per shift at a volunteer ambulance corp.

When a member comes in, they would sign in, they would input their name
and the time they arrived. (Start Time)
When a member finishes his/her tour, they note the time they are done.
(End Time)

I need to be able to calculate the amount of time that person was
volunteering for that specific shift.
We use 24:00 format for all times.
Some members may come in at 22:00 and leave at 05:00, that presents a
calculation problem becasue its spanned accross 2 different dates.
Althought its one 24 hour period for the tour.

Ultimatley I will need this information to print out a report on how
many hours that member volunteered per month.


Does anyone have any ideas on how to perform this time calculation?




Reply With Quote
  #3  
Old   
EMTMark@gmail.com
 
Posts: n/a

Default Re: File Maker Time Calculations - 01-02-2007 , 06:50 AM



Hmm, thank you for that information, I guess I would have to devise
some sort of formula for a case that that.

Well some one may come in on 1/1/07 at 22:00 and leave at 05:00. But
they just input the date that the tour started, not ended. Although I
could possibly subtract get( CurrentDate) from Start Date, although
this may run havoc on calculation dependent fields. Is there a way to
do a calculation once and save it?

Or does someone have a formula recomendation, or should I include the
end date as well?

Thanks to all


Reply With Quote
  #4  
Old   
Grip
 
Posts: n/a

Default Re: File Maker Time Calculations - 01-02-2007 , 07:37 AM



Quote:
Is there a way to
do a calculation once and save it?

Yes, there is. Instead of a calculation field, you use a number field
with an auto-enter calculation and select the 'do not replace' option.
I don't think that's what you want here.


Quote:
Or does someone have a formula recomendation, or should I include the
end date as well?
Assuming no shift lasts longer than 23 hours and 59 mins and you're
ignoring DST, you don't need dates, but a simple If() statment.

//START CALC
//This calc determines hours worked in a 24 hour period.

//If shift is in one calendar day

If( TimeIn>TimeOut;

// Then subtract time out from time in

TimeIn-TimeOut;

//Otherwise, the shift spans midnight, so get time worked between
//shift start and midnight and add it //to time worked from midnight to
//shift end.

(24-TimeOut)+TimeIn) )

//Now divide by number of seconds in an hour to get the number of
hours.

/3600

//END CALC

G



Reply With Quote
  #5  
Old   
Bill
 
Posts: n/a

Default Re: File Maker Time Calculations - 01-02-2007 , 08:19 AM



In article <1167717101.047997.90160 (AT) 42g2000cwt (DOT) googlegroups.com>,
EMTMark (AT) gmail (DOT) com wrote:

Quote:
Hello, I am trying to calculate an elapsed time for hours volunteered
per shift at a volunteer ambulance corp.

When a member comes in, they would sign in, they would input their name
and the time they arrived. (Start Time)
When a member finishes his/her tour, they note the time they are done.
(End Time)

I need to be able to calculate the amount of time that person was
volunteering for that specific shift.
We use 24:00 format for all times.
Some members may come in at 22:00 and leave at 05:00, that presents a
calculation problem becasue its spanned accross 2 different dates.
Althought its one 24 hour period for the tour.

Ultimatley I will need this information to print out a report on how
many hours that member volunteered per month.


Does anyone have any ideas on how to perform this time calculation?
If you use Timestamp fields for the check in and check out, that
combines date and time. You can subtract one timestamp field from
another and the difference will be in days, hours, minutes and seconds.
The difference between two timestamps less than 24 hours apart will be
in hours, minutes and seconds.

To get the timestamps of check in and check out, you can put pushbuttons
on the layout to call scripts that set the the check in and check out
timestamp fields to the current date and time based on the system clock.

--
For email, change <fake> to <earthlink>
Bill Collins


Reply With Quote
  #6  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: File Maker Time Calculations - 01-02-2007 , 09:28 AM



If you're in FileMaker 7 or later, then take advantage of the Timestamp
field types. You can have the volunteer enter date and time in two
separate fields if you'd like and then create a calc based on those
fields (see 'help' for the Timestamp() function).

Or if you're setting it up so that the volunteer just clicks a button to
automatically insert current date and time, this is easily done with the
Set Field script step, setting the field to get(currentTimestamp).

With timestamps, the subtraction between start and end timestamps is
easy, even if they are on different days. You'll likely need to do some
manipulating to get the final result in the format you want.


EMTMark (AT) gmail (DOT) com wrote:
Quote:
Hello, I am trying to calculate an elapsed time for hours volunteered
per shift at a volunteer ambulance corp.

When a member comes in, they would sign in, they would input their name
and the time they arrived. (Start Time)
When a member finishes his/her tour, they note the time they are done.
(End Time)

I need to be able to calculate the amount of time that person was
volunteering for that specific shift.
We use 24:00 format for all times.
Some members may come in at 22:00 and leave at 05:00, that presents a
calculation problem becasue its spanned accross 2 different dates.
Althought its one 24 hour period for the tour.

Ultimatley I will need this information to print out a report on how
many hours that member volunteered per month.


Does anyone have any ideas on how to perform this time calculation?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Professional Solutions, Inc. Los Angeles

FileMaker 8 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #7  
Old   
EMTMark@gmail.com
 
Posts: n/a

Default Re: File Maker Time Calculations - 01-04-2007 , 03:16 AM



I have used the time stamp approach, and formatted the date to <none>.
I works great, thank you all for your help.

Although during entry it does display the date, but no big deal


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.