Skip to main content
Question

Difference between dates

  • November 7, 2020
  • 0 replies
  • 71 views

I wonder if anyone could help? 

I'm looking to set up a formula that shows- The difference between an initial date and the earlier of a) today's date or a specified date. 

I.e- Bob introduces a site 01.01.2020. We respond within 7 days (and record that date in the system- 08.01.2020) which returns a result of 7. However, if we haven't responded, yet, and the date is say 12.01.2020 it records a figure of 11. 

Thank you.

------------------------------
James Ahearne
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
np
I like to use formula variables even for simple formuals as it makes them easier to read later.  A formula variable is like a mini field that only has life inside the formula box. 

var date EndDate = IF(not IsNull([Date Responded]), [Date Responded], Today());
ToDays($EndDate - [Initial Date])

// subtracting dates gives a result as a Duration, which is a sense of elapsed time in no particular units.
// So we use the ToDays function to convert to the numeric number of Days.
// lines beginning with // slashes are comments which are allowed on formula boxes.

 


------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------