How can I calculate the duration of a project to display in a table? I have a field "Date Created".

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
Photo of Kurt Kelsey

Kurt Kelsey

  • 230 Points 100 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Kurt Kelsey

Kurt Kelsey

  • 230 Points 100 badge 2x thumb
Not only do I need to see from "Date Created" to "Date Completed", but would also like to see "Date Created" to Todays Date if not completed.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,456 Points 50k badge 2x thumb
Try this as a formula numeric field called [Project Duration Days]

var date EndDate = IF(not IsNull([Date Completed]),[Date Completed],Today());

ToDays($EndDate - ToDate([Date Created]))

The built in field for [Date Created] is actually a date/time field type so that is why it needs to be converted to a date with the ToDate function.
(Edited)
Photo of Kurt Kelsey

Kurt Kelsey

  • 230 Points 100 badge 2x thumb
Another question if I may.
In a message from quickbase, I want to put a link to the original message in the email.
I know that the link is created using:  %recLink%

However, is it possible to put this in a href tag?
<a href="%recLink%">REPLY to this message</a>

It is not displaying properly in my test
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,456 Points 50k badge 2x thumb
I suggest that you build you own link.

Here is an example.

I always do them this way as that way the syntax is always correct the first time.

var text Words = [Account Name];
var text URL = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#];

"<a href="  & $URL & ">" & $Words & "</a>"
(Edited)
Photo of Kurt Kelsey

Kurt Kelsey

  • 230 Points 100 badge 2x thumb
Worked Perfectly!!!   Thank you so much!!