Search code examples
crystal-reports

Formula that displays data if the word ends with particular string


I need a formula that, if the ItemDescription contains the words "Black Feet", displays "romano chair" without the word "Feet".

My current formula is:

if WorkOrder.ConfigProptext} like "*Feet*" then

How can I do this in Crystal?


Solution

  • To replace every instance of "Black Feet", use:

    REPLACE({Table.ItemDescription}, "Black Feet", "Romano Chair")
    

    If you want a condition returns true if the description contains "Feet", use:

    INSTR({Table.ItemDescription}, "Feet") > 0