Calculate the number of days between Today and Date Modified

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
I need a formula to calculate from todays date to the time a project was last modified.
Any help would be appreciated!!
Photo of Kurt Kelsey

Kurt Kelsey

  • 230 Points 100 badge 2x thumb

Posted 4 months ago

  • 0
  • 1
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 2,266 Points 2k badge 2x thumb
Today() - [Date Modified]
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,126 Points 50k badge 2x thumb
If you want a numeric field for the # of days , it would be
ToDays(Today() - ToDate([Date Modified]))
Photo of Kurt Kelsey

Kurt Kelsey

  • 230 Points 100 badge 2x thumb
Here is what I get:

The expression Today() on the left hand side of the operator "-" is of type datewhile the expression [Date Modified] on the right hand side is of type date/time. The operator "-" cannot be used with these types of expressions.
Photo of QuickBasePros_IDS

QuickBasePros_IDS, Champion

  • 2,266 Points 2k badge 2x thumb
This is because the [Date Modified] is a Date/Time field, and Today() is a "Date" value. 

Mark's comment about displaying the number of days as a numeric value would be the formula to use:

ToDays(Today() - ToDate([Date Modified]))
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,126 Points 50k badge 2x thumb
Did you try my formula as a Formula numeric field type?
Photo of Kurt Kelsey

Kurt Kelsey

  • 230 Points 100 badge 2x thumb
Worked like a charm!!!  Thank you kindly.