You can't use a function in an application to do this unless the function is in the database, in which case it can be called either in the select statement of a command or, if you're using just tables/views on your report, you can create a SQL Expression that will call the function.
If this is not in your database, you'll need to recreate the logic for it in a Crystal formula.
-Dell