Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cognos 8.4 Report Studio cast character as number

Status
Not open for further replies.

CrystalLion

Programmer
Jan 3, 2007
113
US
In Report Studio, I have created a data item that equals only the digits found in a Character field, such as If([Additional Information] contains '4') then ('04') else (...etc.

I would like to cast this result as an integer, and compare it to the dd portion of a DATE_TIME field.

What would the syntax be for this.

 
case
when [additional information] contains '4' then 4
when [additional information] contains '5' then 5
....
else 0 end

Beware the order in which the case is build decides which value is returned

So ,the string 54 yields 4 since the '4' option is evluated before the '5' option..

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top