COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Kam2718 on 24 Mar 2009 08:20:34 AM

Title: DateDiff
Post by: Kam2718 on 24 Mar 2009 08:20:34 AM
I am new to cognoise and I have a question I hope I can get answered.

First off I am using Report Stupio and my first problem was the Date of birth field.  I found a way to remove the timestamp off of the end.  cast([dob],date).  With that being said I now need to figure out the age of the person.  I have been playing around with DateDiff but I keep getting an error. 

datediff([DOB],getdate() )            Any suggestions would help.

Thanks in advance,
Title: Re: DateDiff
Post by: blom0344 on 24 Mar 2009 02:36:08 PM
Why not try the Cognos functions like '_days_between' instead of using native T-sql functions? The native functions should also work when activated in the package, but you do need to check the correct syntax of datediff..