PDA

View Full Version : Using width criteria in an If statement



Gareth Horton
July 12th, 2002, 02:28 PM
Jennifer Saunders wrote:
> I have a situation where I have a column of information that is 6 characters wide. However, some of the data in the field is only 5 characters wide, and I need to add a zero to the just the front of the ones that are 5 characters wide.
>
> I know how to create a calculated field that will add a 0 to the front of the whole field, but was trying to use an IF statement to say, If this number is only 5 characters, add a 0 to the front. If anyone can help, I would appreciate it.
>
>
>
>

Jennifer

This is what you need

IF(<FIELDNAME>="?????","0"+<FIELDNAME>,<FIELDNAME>)

This field needs to be a character field.

Regards

Gareth