# Time and Number

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

## Recommended Posts

Here's my problem...

I need to calculate this and get an amount at the end of the process:

8:00 (time field) (time worked) * \$30.00 (number field) (hourly rate) = \$240.00

It messes up when a field calculates a time field by a number field.

The solution would be \$240 and would be automatic.

Thanks all for you help.

Version: v6.x

##### Share on other sites

Time values are stored as seconds. You need to divide the time by 3600 to get hours. So your calculation should be:

time field / 3600 * hourly rate

##### Share on other sites

The "time" field should really be a number field.

A bit of understanding about time and date fields is required here. Dates are stored as "number of days since 1/1/0001". Time is stored as "number of seconds since midnight". So multiplying a time field by a number will produce unexpected results. (Meaningless results in fact: it's like asking what's 30 times 8:00 pm.)

You need to either have a field that stores the "number of hours worked" (note how I described it, "hours" not "time") or have people enter a start time and a finish time and get FMP to calculate the hours worked.

If you decide to enter start and finish times, remember that you also need to track the start and finish dates too otherwise weird results occur when somebody works past midnight. Remember that time fields are stored in seconds so you need to divide by 3600 to convert them to hours. Similarly, date fields are stored in days so you need to multiply by 24 to get hours out. The final calculation might be:

((FinishDate - StartDate) * 24) + ((FinishTime - StartTime) / 3600)

##### Share on other sites

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

## Create an account

Register a new account