|
I have crystal report for a medical facility that is grouped by patient' snames. I have used a formula for the names since some names are very long, and others are short. Using a formula would allow the names to look uniform. If use a different field for each part of a name, I have to make the fields very wide for long names and the spacing will look bad if the names are short. (I hope that makes sense).
I want the grouping to be last name, first name, middle intial. I have created a formula for this:
{@PLast} & ", " & {@PFirst} & " " & {@PMidInt}
The problem I am running into with this formula is some patients don't have a middle initial entered in the database so their record is being excluded. I want the report to show the patients middle initial if they have one, but not exclude the record if they don't have one.
I have tried to create a if / then statment in the formula so if no middle initial is present, to list list the patient as last name, first name. But I can't get the formula correct.
Here is what I have:
{@PLast} & ", " & {@PFirst} & " " & {@PMidInt} & if {@PNameMI} = NULL then {@PLast} & ", " & {@PFirst}
When I check the validity of the formula I get an error message stating "A number, currency amount, boolean, date, time, date-time or string is expected here."
I am a newbie and probably doing this completely wrong. Any advice would be greatly appreciated.
Edited by dlabrec - 19 Jun 2008 at 1:05pm
|