0

Could anyone say what is the wrong with the below statement.

Currently I'm working in cognos 10.1.1

case     
  when extract(month,_last_of_month (current_date))=1 then ('January')
  when extract(month,_last_of_month (current_date))=2 then ('January','February')  
end

I couldn't correct it.

The error code is qe-def-0459 cclexception parsing error

arunpandiyarajhen
  • 643
  • 12
  • 20
  • 51

2 Answers2

1

it should return only one value,

case
   when extract(month,_last_of_month(current_date)) = 1 then 'January'
   when extract(month,_last_of_month(current_date)) = 2 then 'January, February'
end
John Woo
  • 258,903
  • 69
  • 498
  • 492
1

I also believe in all Case Statements in Cognos you must have an else condition as well. I don't have cognos in front of me and cant remember the syntax of the functions you are using but it looks good.

Also i remember in some versions of cognos you had to convert the eval expression to the same as the return type meaning since you are returning text instead of expr = 1 you would have to Cast(expre, varchar) = Cast(1, varchar) --- Not sure if this is the case in 10 but it definitely caused problems sometimes as recently as 8.3 and 8.4