If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

CAST statement on Yes/No field

Started by ry1633, 25 Feb 2016 10:19:59 AM

Previous topic - Next topic

ry1633

Is it possible to use the CAST statement on data field that has Y/N as it's type,   so expand the text so the columns display the full word 'Yes' or 'No'?

Lynn

Quote from: ry1633 on 25 Feb 2016 10:19:59 AM
Is it possible to use the CAST statement on data field that has Y/N as it's type,   so expand the text so the columns display the full word 'Yes' or 'No'?

The cast function is for changing a field from one data type to another, such as casting a number to a string.

In your situation you might consider a case statement. Of course this adds processing time to your query so I would always advise having these types of translations done in the database as part of the ETL process.


case [your field]
  when 'Y' then 'Yes'
  when 'N' then 'No'
  else 'Unknown'
end

ry1633

great I'll try this out and see how it acts in my environment.  Thanks so much.