![]() |
|
#1
|
|||
|
|||
![]() Here is a screenshot comparing your field, as repaired by Jay Freedman, and one from the tutorial. The date picker has a bookmark set of "Birthdate."
When a date is entered and then the fields are selected and updated (F9), the result is: What is the birthdate? 6/20/1966 Your field Age: Field from tutorial with BirthDate substituted for StartDate and Date substituted for EndDate. 57 Years, 2 Months, 22 Days. ================================ Note, your field produced no result. I have no interest in trying to fix it. Jay Freedman, in your other post already corrected the matching of braces. Here is the second field in text, which could be converted to a real field using Graham Mayor's utility. (Do not try typing it yourself unless you really like pain.) {QUOTE{SET sy{BirthDate \@ yyyy}}{SET sm{BirthDate \@ M}}{SET sd{BirthDate \@ d}}{SET ey{Date \@ yyyy}}{SET em{Date \@ M}}{SET ed{Date \@ d}}{SET md{=IF((em=2),28+(em=2)*((MOD(ey,4)=0)+(MOD(ey,400 )=0)-(MOD(ey,100)=0)),31-((em=4)+(em=6)+(em=9)+(em=11)))}}{Set Years{=ey-sy-(em<sm)-(em=sm)*(ed<sd)}}{Set Months{=MOD(12+em-sm-(ed<sd),12) \# 0}}{Set Days{=MOD(md+ed-sd,md) \# 0}}"{Years} Year{IF{Years}= 1 "" s}, {Months} Month{IF{Months}= 1 "" s}, {Days} Day{IF{Days}= 1 "" s}."} Here it is in text trimmed to simply produce the number of years. {QUOTE {SET sy{BirthDate \@ yyyy}} {SET sm{BirthDate \@ M}} {SET sd{BirthDate \@ d}} {SET ey{Date \@ yyyy}} {SET em{Date \@ M}} {SET ed{Date \@ d}} {SET md{=IF((em=2),28+(em=2)*((MOD(ey,4)=0)+(MOD(ey,400 )=0)-(MOD(ey,100)=0)),31-((em=4)+(em=6)+(em=9)+(em=11)))}} {Set Years{=ey-sy-(em<sm)-(em=sm)*(ed<sd)}} "{Years}"} Last edited by Charles Kenyon; 09-16-2023 at 10:17 AM. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create report for when a date is 3 years old | Daronovitz | Excel | 5 | 11-01-2022 02:42 PM |
Word 2016: How do I change a REF field code to display a reference to a Roman number as Arabic | Peggy Sue | Word | 1 | 08-15-2017 09:50 PM |
![]() |
lyiio | Excel | 3 | 08-13-2017 12:12 AM |
Is this possible? - Calculate and Display the date range between 2 specific dates | Premier-UK | Excel | 2 | 08-18-2014 05:43 AM |
![]() |
vandy | Word | 1 | 09-23-2009 11:32 AM |