July 25, 200619 yr Hi, Can you please help with a calculation that will subtract the visit date - date of birth. The results shall be provided to the user in years, months, weeks, and days. I have attached a small file for testing. thank you so much who ever you are.... Date_Calc.zip Edited July 25, 200619 yr by Guest
July 25, 200619 yr This question comes up from time to time. Do a search for [color:blue]+Birthday +Calculation as the [color:blue]Keywords, with or without my name as the username, and you will find many calculations that will provide the bases of what you are needing. Here is one of the most recent threads Link that should get you going. Just replace the [color:red]Get (CurrentDate) with your [color:red]visit field. HTH Lee
July 25, 200619 yr Author Hi, Thanks for the resource but i tried copying your code into my db into the fied age_years and no luck. I tried your code but substituted your currentdate field with my vis_date field and when i click ok i get a pop up message saying "This parameter is an ivalid get function". This is the code i used. GetAsNumber(Year(Get(vis_Date)) - Year(dateofbirth) - Case(Get(visDate) < Date(Month(dateofbirth); Day(dateofbirth); Year(Get(vis_Date))); 1; 0)) & " Years, " Would you know why it is not working?
July 25, 200619 yr Year( vis_date ) - Year( dateofbirth ) - ( vis_date < Date ( Month ( dateofbirth ) ; Day ( dateofbirth ); Year ( vis_date ) ) ) & " Years, " result text. BTW: this covers only the first part of your question how many years ?
July 26, 200619 yr Hi Maria, Compare this to what you were trying to put in the calculation GetAsNumber(Year(vis_Date)) - Year(Dob) - Case(vis_Date) < Date(Month(Dob); Day(Dob); Year(vis_Date))); 1; 0)) & " Years, " & GetAsNumber(Mod(Month(vis_Date)) - Month(Dob) + 12 - Case(Day(vis_Date)) < Day(Dob); 1; 0); 12)) & " Months, " & GetAsNumber(Day(vis_Date)) - Day(Dob) + Case(Day(vis_Date)) >= Day(Dob); 0; Day(vis_Date) - Day(vis_Date))) < Day(Dob); Day(Dob); Day(vis_Date) - Day(vis_Date))))) & " Days" HTH Lee Edited July 26, 200619 yr by Guest
July 26, 200619 yr Maria, I added a field with Lee's calc. Just change visit date and it will change the year month and day. Hope this helps you get an idea how it works. Dean Edited July 26, 200619 yr by Guest
Create an account or sign in to comment