COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: terry_stjean on 25 May 2008 05:19:11 PM

Title: Convert money to char
Post by: terry_stjean on 25 May 2008 05:19:11 PM
In Report Studio, how can I convert a money data type field to a char.
The backend database is SQL Server.

Terry
Title: Re: Convert money to char
Post by: blom0344 on 26 May 2008 02:14:38 PM
cast([somefield of type money] as char(20))
Title: Re: Convert money to char
Post by: terry_stjean on 27 May 2008 07:06:39 AM
I tried your suggestion but all I get is a 1 for the value.

Terry
Title: Re: Convert money to char
Post by: blom0344 on 27 May 2008 07:19:52 AM
Did you adjust the aggregate type to none for the object?
Title: Re: Convert money to char
Post by: almeids on 27 May 2008 08:30:40 AM
When you say "money to char" do you mean you want to spell the value, like "one hundred and twenty three"?
If so you'll need to look for a database function to do this, I know Oracle has one but don't know about SQL Server.