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
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?
cast the date functions.... :)