Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use _age() function

Status
Not open for further replies.

JPCogAdmin

Programmer
May 22, 2006
110
US
Hi,

How do you use the _age() function in Cognos 8 to show age in years only? IE. 60 or 53....

I'm trying to use it but it give me YYYYMMDD
so, I'd like to strip out MMDD and just return the YYYY.
Thanks for any help.
 
Hi,

You could try using the extract() function to extract the year from your result. Does this give you what you need?

Regards,

MF.
 
Calculating someone's age is slightly more complicated.
Since the result returned is a number like 440301 we divide the result by 10000 and round the result to an integer value
(44 in this case)

In my case:

Code:
_round((_age(1963-08-28)/10000);0)

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top