Skip to Content
Former Member
Oct 25, 2016 at 02:25 PM

Crystal Reports - case varchar changed to a 'string' datatype and truncated to 32


Hi, I am using Crystal Reports version

I am using the 'Command' option in the database expert section. I have a case statement with multiple when clauses: when fielda 'xxxx' then 'xxxxxxxxxxx' , when fielda 'yyyyy' then 'yyyyyyyyyyy', etc. I end the case statement with End as 'Description'. 'fielda' is a varchar 255 field (usuall never gets anywhere near 255), but the command is defaulting the 'Description' to a String [32] datatype. So my display description of 50 characters gets truncated to 32 characters. I have done many searches and I see that there are truncation issues with CR but I couldn't find my exact issue. I did find one that said to use 'Cast' so I tried that but it didn't work. This is what I tried:

When fielda like '%xxxx%' then CAST('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' as VARCHAR(50)).

Any help with this issue would be deeply appreciated.