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'?
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
great I'll try this out and see how it acts in my environment. Thanks so much.