Connecting Tech Pros Worldwide Help | Site Map

QBE function for filling 11 digits

Kermit Piper
Guest
 
Posts: n/a
#1: Feb 3 '06
Hello,

I have been trying to come up with a IIF function to do the following
in a QBE grid:

If a number is 10 digits or less, then add leading zeros to fill up 11
spaces.
Examples:
1234567899 = 01234567899
02356 = 00000002356

If a number is 11, 12 or 13 digits, leave it alone.
Examples:
12345678991
645363736562
6475837645744

Any help would be greatly appreciated.

Thanks,
KP

MGFoster
Guest
 
Posts: n/a
#2: Feb 3 '06

re: QBE function for filling 11 digits


Kermit Piper wrote:[color=blue]
> Hello,
>
> I have been trying to come up with a IIF function to do the following
> in a QBE grid:
>
> If a number is 10 digits or less, then add leading zeros to fill up 11
> spaces.
> Examples:
> 1234567899 = 01234567899
> 02356 = 00000002356
>
> If a number is 11, 12 or 13 digits, leave it alone.
> Examples:
> 12345678991
> 645363736562
> 6475837645744[/color]


format(456789,string(11,"0"))

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Kermit Piper
Guest
 
Posts: n/a
#3: Feb 3 '06

re: QBE function for filling 11 digits


Wow, that easy? Thanks, I'll give it a try.

Closed Thread