Skip to main content
Question

Can a formula ever use different field types?

  • May 23, 2017 2:07 AM UTC
  • 0 replies
  • 68 views

I?m trying to put a Remaining Depreciation formula together, but it uses a duration and a currency field.  From what I've seen, using two different field types in a formula does not work. Is there any way around this or will the two different field types never work in a formula? 


Here are the details: I?ve got two tables, Inventory & Inventory History.  Inventories can have many Inventory Histories/

 

The Inventory Histories table contains

Date Sent to Client (a date field)

Date Returned (a date field)

Days in Field (A duration formula)

 

The Inventory table contains:

Total Days in Field (a summary duration field from the Inventory History table)

Cost (a numeric currency)

Depreciation Term (days) (a duration field)

Remaining Deprecation (a numeric formula) THIS IS THE FORMULA FIELD THAT I'M TRYING TO CREATE.  
This topic has been closed for replies.

  • Author
  • Qrew Corporal
  • May 23, 2017 2:46 AM UTC
In case it helps.. The Remaining Deprecation would preform this function: 1. Divide the Deprecation Term by the Cost to calculate the a cost per day.  2.Take the cost per day and times it by the Total Days in Field and then subtract it from the Cost.

Re: will the two different field types never work in a formula? 
In fact, two different field types can always work in a formula because there are a whole set of function to convert from one field type to another.

Try this.

var number DepreciationCostPerday = [Cost] / ToDays([Depreciation Term]);

[Cost] - $DepreciationCostPerDay * ToDays([Total Days])

  • Author
  • Qrew Corporal
  • May 23, 2017 5:31 AM UTC
Thank you so much for showing me the way!