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

need help with date intervals

Started by vkraju, 24 Sep 2008 10:53:47 AM

Previous topic - Next topic

vkraju

Hi all i have a problem in writing a if statement
example is:

If code = '1'
then
(date1-date2)
else
if code='2'
then
(date2-date3)
else
(' ')

cognos is giving an error.
how do i write the sql for this kind of time interval using a code.

thanks
Kris

blom0344

First , try to get used to CASE statements as these are easier to read then IF THEN ELSE.
There is a function called datediff for calculating difference between dates.
Did you take a look at the standard Cognos functions that are available?

the_xxx