6 Digits

1. Che
Senior Member
Join Date
Dec 1969
Posts
303

## 6 Digits

I am reading values and see whether each value is having 6 DIGITS or not if not i need to add "Zeroes" infront of each value to make 6 DIGITS... Help me here... Some values are having 5 Digits, some are 4 digits... <BR><BR>---------------------------------------------------------<BR>Code = val<BR> for j = 1 to (6-len(Code))<BR> Code = "00"&Code &#039;?????<BR> next

2. Senior Member
Join Date
Dec 1969
Posts
96,118

## Easier way...

Code = Right( "00000" & val, 6 )<BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
497

## shouldn't there be

6 zeros? in case of empty value<BR><BR>Code = right("000000 & val,6)

4. Senior Member
Join Date
Dec 1969
Posts
96,118

## <shrug>Sure...

...but I suspect if val is empty then he has other problems.<BR><BR>Usually, I do put in all 6, though. Dunno why I didn&#039;t today.<BR><BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•