PC Review


Reply
Thread Tools Rate Thread

add leading zeros

 
 
=?Utf-8?B?SmFjcXVlbGluZQ==?=
Guest
Posts: n/a
 
      12th Jul 2006
In working on a database to remove redundancies and make it more efficent I
have run into a problme that I just do not know how to fix. Often when
restructuring tables it is easier to throw the data into EXCEL and then
import it back into the DB.

Becuase I must preserve the data that is currently in the DB rebuilding
tables can be madding. In this case I need to reformat the primary key which
is a field containing some SSNs, and some made up numbers of various lengths.

I want to reformat the feild to 9 charactors, but need to insert leading
zeros to the made up numbers. Example: one number is 118, and would need to
be reformated as 000000118.

There a several different number lengths which makes my job all the harder.
Is there a way to do this that I am not seeing? Any help will be greatly
appreciated...
--
Jacqueline
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWFyY2Vsbw==?=
Guest
Posts: n/a
 
      12th Jul 2006
Hi Jacqueline,

try on an auxilar column this formula

=rept("0",9-len(a2))&a2

hope this helps
regards from Brazil
Marcelo

"Jacqueline" escreveu:

> In working on a database to remove redundancies and make it more efficent I
> have run into a problme that I just do not know how to fix. Often when
> restructuring tables it is easier to throw the data into EXCEL and then
> import it back into the DB.
>
> Becuase I must preserve the data that is currently in the DB rebuilding
> tables can be madding. In this case I need to reformat the primary key which
> is a field containing some SSNs, and some made up numbers of various lengths.
>
> I want to reformat the feild to 9 charactors, but need to insert leading
> zeros to the made up numbers. Example: one number is 118, and would need to
> be reformated as 000000118.
>
> There a several different number lengths which makes my job all the harder.
> Is there a way to do this that I am not seeing? Any help will be greatly
> appreciated...
> --
> Jacqueline

 
Reply With Quote
 
Arvi Laanemets
Guest
Posts: n/a
 
      12th Jul 2006
Hi

For your example data:
=TEXT(118,"000000000")

Arvi Laanemets



"Jacqueline" <(E-Mail Removed)> wrote in message
news:C603E148-A61B-4A45-BD26-(E-Mail Removed)...
> In working on a database to remove redundancies and make it more efficent

I
> have run into a problme that I just do not know how to fix. Often when
> restructuring tables it is easier to throw the data into EXCEL and then
> import it back into the DB.
>
> Becuase I must preserve the data that is currently in the DB rebuilding
> tables can be madding. In this case I need to reformat the primary key

which
> is a field containing some SSNs, and some made up numbers of various

lengths.
>
> I want to reformat the feild to 9 charactors, but need to insert leading
> zeros to the made up numbers. Example: one number is 118, and would need

to
> be reformated as 000000118.
>
> There a several different number lengths which makes my job all the

harder.
> Is there a way to do this that I am not seeing? Any help will be greatly
> appreciated...
> --
> Jacqueline



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace leading zeros with leading spaces ? Gary Microsoft Excel Programming 4 7th Jan 2010 11:39 AM
leading zeros & trailing zeros =?Utf-8?B?Q01jR3Jhbm4=?= Microsoft Access External Data 2 5th May 2006 02:47 PM
save text field w/ leading zeros in .csv format & not lose zeros? =?Utf-8?B?UXVlcw==?= Microsoft Excel Misc 1 4th May 2005 06:21 PM
Leading Zeros Eric Graham Microsoft Excel Discussion 2 4th Jan 2005 07:23 PM
Leading Zeros Richard Microsoft Excel Worksheet Functions 3 23rd Oct 2003 11:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:53 PM.