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
Age calculation from Date Of Birth
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 42
- Joined: Mon Apr 21, 2008 1:49 am
-
- Participant
- Posts: 24
- Joined: Mon Jul 12, 2004 10:16 am
Re: Age calculation from Date Of Birth
Use TAG.TO.YEAR for date of birth and current date and subtract these values will get you the Age of the customer.
What format and datatype is "Date of Birth"? And is "age" an integer number of years?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 42
- Joined: Mon Apr 21, 2008 1:49 am
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?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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).
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 42
- Joined: Mon Apr 21, 2008 1:49 am