Forum Discussion
This is a pretty down and dirty attempt at it but something like this seems to get me in the ballpark more or less. It doesn't really consider leap years so you may need to try and adjust if that's an issue. I ran some tests and more or less seems to be working.
------------------------------
Chayce Duncan
------------------------------
- ShaneMiller9 months agoQrew Trainee
Thank you for replying Chayce. What you came up with is really impressive.
When inputting the date 01-01-1992 I get the result of "For 31 years, 10 months, 34 days".Obviously this has to do with the leap yea you mentioned. I will try tinkering with it to see if I can figure it out. It is way further than I was able to do, so either way I am satisfied. Thank you!
------------------------------
Shane Miller
------------------------------- MarkShnier__You9 months agoQrew Legend
Try this one if you like.
var date MyDate = [My Date];
var text Years = ToText(Year(Today())-Year($MyDate) -
If( Month(Today())<Month($MyDate)
or
(Month(Today())=Month($MyDate) and Day(Today())<Day($MyDate)),1,0));
var text Months = If(
Month(Today()) > Month($MyDate), ToText(Month(Today()) - Month($MyDate)),
Month(Today()) = Month($MyDate) and Day(Today()) >= Day($MyDate), ToText(Month(Today()) - Month($MyDate)),
Month(Today()) = Month($MyDate) and Day(Today()) < Day($MyDate), "11",
ToText(12-(Month($MyDate) - Month(Today()))));
var text DaysDisplay = If ( Day(Today()) > Day($MyDate), ToText( Day(Today()) - Day($MyDate) ),
Day(Today()) = Day($MyDate), "0",
Day(Today()) < Day($MyDate), ToText( Day($MyDate)-Day(Today()) ));
var text RawResult=
$Years & " Year" & If ($Years <> "1","s","") & "<br>" &
$Months & " Month" & If($Months<>"1","s", "") & "<br>" &
$DaysDisplay & " Day" & If($DaysDisplay<>"1","s", "");
If(not IsNull($MyDate), $RawResult)
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- ShaneMiller9 months agoQrew Trainee
Perfect! Thank you Mark
------------------------------
Shane Miller
------------------------------