From: CS on
How do I add leading zeros to this?

BLDG: Mid([LOCATION],InStr([LOCATION],"-")+1)

Please help.
From: Marshall Barton on
CS wrote:

>How do I add leading zeros to this?
>
>BLDG: Mid([LOCATION],InStr([LOCATION],"-")+1)
>

How many zeros? If its alway the same number:
BLDG: String(howmany, "0") & Mid(LOCATION, InStr(LOCATION,
"-") + 1)

If you want to pad it out so the result is a specific
length:

BLDG: Right(String(99, "0") & Mid(LOCATION,
InStr(LOCATION, "-") + 1), specificlength)

--
Marsh
MVP [MS Access]
From: KARL DEWEY on
My response yesterday --
Left([YourField], InStr([YourField], "-")-1) & Right("00000" &
Mid([YourField], InStr([YourField], "-")+1, 5)

--
Build a little, test a little.


"CS" wrote:

> How do I add leading zeros to this?
>
> BLDG: Mid([LOCATION],InStr([LOCATION],"-")+1)
>
> Please help.