If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Question about using the 'Age' function

Started by cac416, 21 Jan 2009 03:16:39 PM

Previous topic - Next topic

cac416

I used the 'age' function which will return a value between a dob and current date.  The format of the value is yymmdd.  I can see the age in years is correct and I want to pull that out so I have a two digit age.  If I use the 'years between' to calculate, the ages are incorrect by one year (most of them).

How do I pull out just the years?

Any ideas?

Thanks!!

Rajaggopal

Hi,
Try using this expression to pull out just the years.

cast( ([Data Item]/10000), integer)

Assuming the date range returned is either a 6 digit number or a 5 digit number... This should return only the quotient value which would be the number of years...

P.S: I tried to find any difference between the years obtained using age and years_between and i cudnt find one... Can you please post some sample DOB values for which these values differ?

ajaju

Hi,

You can also try using this expression

(integer(substr(char(_age(Patient Date of Birth)),1,4)))

This will first give you the age.Then to get the first two digit from the age you need to use 'substr' function.