general suggestion
It's often easier to write condintional calculations as calculated fields instead of writing them inside your SQL statements.
step by step guide:
- Make the field explorer visible, by either using the icon in the tool bar or the menu "View -> Field Explorer"
- Look up the entry for formula fields with the fx symbol and right-click to open the context menu. Choose "New..."
- The formula editor will open and you can use the crystal report programming language to create your conditional value
- You can drag and drop the formula field from the field explorer in the same way to your report as you can do it with the database fields.
I apologize for the German screen shots. I have no English Crystal Report installation available. Maybe some captions will vary from my translations of the terms.