Forum Discussion
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
------------------------------
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
------------------------------