Alexander
Alexander

Reputation: 1687

Changing Column Text (Crystal)

I'm fairly new to Crystal and a user wants me to change column text to tulip if the model is like FT-T*. I figured this would be something fairly easy and tried a few different formulas, but could get them to work. Can you tell me what my formula is doing wrong or what formula I would need to use instead? Thanks.

IIF({v_FrameDepartment.cftliner} Like 'FT-T*' THEN {v_FrameDepartment.cftliner} = 'Tulip' 

Upvotes: 0

Views: 69

Answers (1)

You can use LEFT({v_FrameDepartment.cftliner}, 4) in your formula to check for a match:

IIF(LEFT({v_FrameDepartment.cftliner}, 4) = "FT-T", "Tulip", 
    {v_FrameDepartment.cftliner})

It's been a little while since I used CR, so I can't remember if LEFT throws an error if you specify a length greater than the length of your string. If it does, just check the length of {v_FrameDepartment.cftliner} first.

Upvotes: 1

Related Questions