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

How to ??

Started by Sudha, 16 Nov 2007 07:30:04 AM

Previous topic - Next topic

Sudha

Hi all,
Does any one know how to produce the following format for Age from this calculation:

Age = Current_Date - Birth_Date

Age is presented in years and months, where the month range is from 0 through 11. Example: 52 years and 11months is formatted as 52.11 on the report.

TIA

MFGF

Hi,

Subtracting two dates like this results in an interval (days,hours,minutes,secs).  What you need instead is a YMDInterval (years,months,days).  If you need to specify both dates, try using the _ymdint_between() function to produce a ymdinterval, then use the extract() function to get hold of the year part, extract() again for the month, then drop these two into you report (list column) with a '.' text item between them.
Alternatively, if you always want to find out age based on the current date, use the age() function to produce your ymdinterval - you only need to specify your Birth Date as an argument.  Again, use extract() to pull out the year and month from the result.

Regards,

MF.

Regards,

MF.
Meep!