Zero filling a string

J

Jerry

I have an autonumber field that I want to put into a text field with
a field size of 10, and left filled with zeroes - for example, the first
autonumber field is 1 and I need the text field to be "0000000001".
The last autonumber field is 25523 and I need the text field to be
"0000025523".

How can I do this in an update query?

Many thanks.

Jerry
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

UPDATE table
SET column = Format(autonumber_column, String(10,"0"))
WHERE < criteria >

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQd2TXoechKqOuFEgEQJNJgCdFG4nGdGJQjqc1wVBzOQo3nwiCNoAoN8B
9EU5jnZj6qOUcsBjAxByC8+w
=ckPy
-----END PGP SIGNATURE-----
 
J

Jerry

Awesome - Thanks!!!


MGFoster said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

UPDATE table
SET column = Format(autonumber_column, String(10,"0"))
WHERE < criteria >

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQd2TXoechKqOuFEgEQJNJgCdFG4nGdGJQjqc1wVBzOQo3nwiCNoAoN8B
9EU5jnZj6qOUcsBjAxByC8+w
=ckPy
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top