I have input in which the Date of birth of customer is given. I need to find the respective age and populate that in my target. How do I achieve this..
Age= Current Date- Year of birth.. How do i go about. is there any inbuilt function for this. Kindly help
The simplest way is to extract the YYYY portion from the birthdate string and subtract it from the numeric YYYY current year value. But is this acceptable according to your business rules? Does the current month/day make a difference?
Yes, you really do need a tighter definition. For example Chinese practice is that a newborn has an age of 1. Do you need to incorporate this possibility in your business rules?
The algorithm begins as ArndW suggests, then tests whether the day and month of birth has already occurred in the current year (in which case add 1).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.