spazz1421 Posted February 4, 2015 Report Share Posted February 4, 2015 Looking to see if someone can help me. Not smart in that java world at all. Just looking to display an age based on the birthday field.... THanks Quote Link to comment Share on other sites More sharing options...
LWSChad Posted February 5, 2015 Report Share Posted February 5, 2015 Use a Report Details data page and the following calculated field Floor((Datediff(day, [@field:DOB], GetUTCDate()))/365.25) Quote Link to comment Share on other sites More sharing options...
Jan Posted February 5, 2015 Report Share Posted February 5, 2015 Hello spazz1421, There is also the article in the How To. Quote Link to comment Share on other sites More sharing options...
spazz1421 Posted July 23, 2015 Author Report Share Posted July 23, 2015 didnt work in free trial but thank you both Quote Link to comment Share on other sites More sharing options...
Xiang Posted July 24, 2015 Report Share Posted July 24, 2015 Good morning Spazz, How are you doing? I think, you can add an HTML Block on your Report and enter the following code: <script>var birth_day = '[@field:birthday]'; var date_birth = new Date(birth_day); var date_today = new Date(); var timeDiff = Math.abs(date_today.getTime() - date_birth.getTime()); var diffYears = Math.ceil(timeDiff / (1000 * 3600 * 24 * 365.25)); document.write(diffYears); </script> Insert the name of your field instead of "birthday". I'm learning the JavaScript now, so, I'll be grateful, if you tell me if the code works. Have a nice day! Uriah 1 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.