I am trying to format a field to ALWAYS be 9 chars wide. The formula below works except when the field is blank. If the field is blank it skips the field without adding the spaces.
Any help would be greatly apperciated.
If ((length(trim({NAME.CCOUNTRY})) < 5) or ((isnull({NAME.CCOUNTRY}))))
then //pad to be at least 5
{NAME.CCOUNTRY}+replicatestring(" ", 5-(length(trim({NAME.CCOUNTRY}))))
else
left({NAME.CCOUNTRY},5) //take 5 left most chars
PS thanks to synapsevampire for the base of this code which worked untill I got my hands on it!!
Any help would be greatly apperciated.
If ((length(trim({NAME.CCOUNTRY})) < 5) or ((isnull({NAME.CCOUNTRY}))))
then //pad to be at least 5
{NAME.CCOUNTRY}+replicatestring(" ", 5-(length(trim({NAME.CCOUNTRY}))))
else
left({NAME.CCOUNTRY},5) //take 5 left most chars
PS thanks to synapsevampire for the base of this code which worked untill I got my hands on it!!