Running Cognos 10.2.2
Have 2 Query Calculations in adjacent columns ... My code has Fully Qualified Paths, but below are simplified to just Query Item/ Field names ...
1 - DiffDays ... to show [Created Date] has been entered, closing the Incident ...
_days_between(cast([Created Date], date) , Cast([Date Of Incident], date))
2 - ContinueDays ... to show [Created Date] has NOT been entered, meaning Incident unresolved ...
_days_between(current_date, [Date Of Incident])
We need a "Simple" If to test if [Created Date] Is NULL, so ...
If [Created Date] Is NULL
Then
_days_between(current_date, [Date Of Incident])
Else
_days_between(cast([Created Date], date) , Cast([Date Of Incident], date))
... BUT isn't working.
HHEELLPP ... TIA, Bob
Try using coalesce instead. Returns the first non null value.
_days_between(cast(coalesce([Created Date],current_date),date),cast([Date Of Incident],date))
THANK you. It WORKS !!!
Too many years VB/ VBA relying on If Then Else, and Select Case.
I now have a new Tool in the Toolbox.