Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculating in FileMaker

Status
Not open for further replies.

IRETH

Technical User
Mar 9, 2005
9
0
0
US
I need to move into FileMaker for a specific project (most of my work has been in Excel).

In FileMaker 7 I have a sign in field and a sign out field. A third field subtracts one from the other giving me the hours worked in the 1:30 format (one hour and a half.) The next field holds the hourly rate of pay. I need to be able to multiply the amount of time worked by the hourly rate. Can anyone help? Thanks in advance.
 
Several ways to go.
If you-re sure the start time and the end time will always be the same day:
((timeStart - timeStop)/3600)*hourRate

Better is to use the power in FM for date and time, which will cover the possibility that the end time will not be on the same day as the start time.
For this we use the TimeStamp function.

Your calculation can be something along these lines:
Let ([
hourStart = GetAsTimestamp ( timeStart );
hourStop = GetAsTimestamp ( timeStop ) ;
diff = GetAsNumber ( hourStop - hourStart );
diffHour = diff/3600];
hourRate * diffHour )

where the timeStart and timeStop fields are type: Timestamp.

I show the formula in its longest form so you can understand what happen within the formula.
There is a way to make it shorter.

HTH
 
Thanks,

The the first solution will work, as start and stop times are all between 8 and 6 on the same day.

I appreciate your help.

Jan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top