# Calculate the number of days between Today and Date Modified

• 0
• Question
• Updated 5 months ago
I need a formula to calculate from todays date to the time a project was last modified.
Any help would be appreciated!!
• 230 Points

Posted 11 months ago

• 0

QuickBasePros_IDS, Champion

• 4,516 Points
Today() - [Date Modified]
• 70,174 Points
If you want a numeric field for the # of days , it would be
ToDays(Today() - ToDate([Date Modified]))
• 230 Points
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.

QuickBasePros_IDS, Champion

• 4,516 Points
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]))
• 70,174 Points
Did you try my formula as a Formula numeric field type?
• 230 Points
Worked like a charm!!!  Thank you kindly.
• 310 Points
I'm trying to get the difference between todays date and the expected start date of a project but if the project has been started already, I want the value to be NA.  I have a text field and it's not letting me put the "-", if I do a numeric, it won't let me do the value NA

If(
not IsNull([Started]),"N/A",
ToText(([Start])-(Now())
)
)
• 310 Points
That worked! Thank you!  One last question, I want the value to be negative to indicate that the task has been done after the expected start date.  I tried to just reverse the 2 functions but now it doesn't work.
• 70,014 Points
Sure, I made the assumption that you wanted a positive number

If(
not IsNull([Started]),"N/A",
ToText(ToDays(ToDate([Start]) - Today())))
• 310 Points
Thank you so much!!!!!
• 310 Points
Ultimate last question on this one.  Is there a way that I can have one decimal place on the number value on this field?
• 70,014 Points
If(
not IsNull([Started]),"N/A",
ToText(ToDays(ToDate([Start]) - Today())))

& ".0"