COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: subhash on 29 Nov 2007 07:56:43 AM

Title: regarding the sql functions in cognos
Post by: subhash on 29 Nov 2007 07:56:43 AM
hi all,

my database is sql server.

  i want to convert the string value to the numeric value.

i used like this cast('sss') --- giving error.

ex: my string is 'Business data'
  i want to convert that string to the numeric value.
Title: Re: regarding the sql functions in cognos
Post by: rockytopmark on 29 Nov 2007 09:04:11 AM
Converting a 'String' to a number is simply not possible, unless the string has numerals in it, like '1234'

If you are trying to convert a Column (query item) that has a numeric value stored as a string, then you can do this but alter your syntax to reference the column:

Cast([QueryItem],<datatype>)