I ended up adding a sql server function to perform the if.. else.
The function, named IsEmpty(), accepts the two field names and checks for an empty or null value.
The fuction works with the sql statement from within sql server.
When I use it in a fields.. ExpressionToApply it surrounds the function parameters(field names being sent) with single quotes when viewing the sql execution in profiler.
Here is how I'm calling the function
fields[2].ExpressionToApply = new DbFunctionCall("LearnAbout", "IsEmpty", new object[] { CategoryRelationFieldIndex.CategoryNameAlias, CategoryFieldIndex.CategoryName });
Is there a way to prevent the function parameters from being surrounded with single quotes?