jbloome Posted April 13 Report Share Posted April 13 Looked around many Caspio forum posts and just wanted to post the latest for calculating Age from a Birth Date Text Field. Set up a text field in your table called: Birth_Date. In the datapage text field for Birth_Date select Calendar Pop-Up. In your details page add underneath the Birth_Date field, a calculated field with the code: FLOOR(DATEDIFF(DAY, [@field:Date_of_Birth1], SysDateTime()) / 365.25). This updates other Caspio previous posts that didn't properly calculate the age. Quote Link to comment Share on other sites More sharing options...
CoopperBackpack Posted April 22 Report Share Posted April 22 I usually use this formula to calculate the exact age and it works correctly too. DATEDIFF(year, [@field:Date_of_Birth], SysDateTime()) - CASE WHEN DATEADD(year, DATEDIFF(year, [@field:Date_of_Birth], SysDateTime()), [@field:Date_of_Birth]) > SysDateTime() THEN 1 ELSE 0 END This formula is also provided in this article https://howto.caspio.com/datapages/reports/advanced-reporting/calculated-fields-and-datediff-function/ Since age calculating requires using functions to get the today`s day and these functions are not supported in the Formula field in the Table, the workaround to store the age in the Table (if needed) is to use a Task: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.