leading zeros

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: KT (KT_at_discussions.microsoft.com)
Date: 01/31/05


Date: Mon, 31 Jan 2005 11:23:03 -0800

I need to change a field in my database from number to text in order to allow
alphanumeric entries. Changing the data type was easy, but I need to update
the current entries to be able to link with other databases.

Currently the data are numbers (3-6 digits long) stored as text. The new
entries will be 10 digit numbers with or without a 4-letter code attached. If
there is no code, then the numbers have to have leading zeros to pad it out
to 10 digits in order to link with the other databases.

i.e. either: 0123456789 or ABCD9876543210

1. How can I update the existing data to 10-digit numbers with leading
zeros? i.e. 1234 to 0000001234 I've been playing with both FORMAT and INPUT
MASK but can't get it to store the whole number, only display it.

2. Is there a way to make this a default for new entries that don't need a
letter code, i.e. can I enter 123456 and have it store as 0000123456?

Thanks!



Relevant Pages

  • Re: Choosing a DataStructure
    ... considering huge amount of entries). ... sometimes databases also uses Hash based indexing. ... > external sorting algorithm like mergesort. ... > The array of pointers to records seems to be the right because it ...
    (comp.programming)
  • Re: invalid use of null
    ... 'load the first combo box with the entries in the databases ... If objrs.EOF = True Then 'if the Accounts table is empty ...
    (microsoft.public.vb.general.discussion)
  • Re: [opensuse] Best hardware DB to contribute to?
    ... There's several online, and I don't have time to contribute to them ... do you have a list of the databases you considered? ... what is your opinion about database on openSUSE wiki, ... Can we structure it better to be easier to browse and add entries. ...
    (SuSE)
  • RE: leading zeros
    ... Can do same in update sql to alter current data. ... > the current entries to be able to link with other databases. ... > Currently the data are numbers (3-6 digits long) stored as text. ...
    (microsoft.public.access.queries)
  • Re: Python to use a non open source bug tracker?
    ... Valentino Volonghi wrote: ... considering that both of these databases have enough tools to deal with ... backups I think it's a non issue. ... 10k entries shouldn't be much of an issue for sqlite3 either. ...
    (comp.lang.python)