By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

modify data (insert one character to beginning of data string)

P: n/a
I have a large database (for me) containing about 23,000 records and I
need to add a single digit (the number 8) to all data currently in a
specific field.. This field contains numbers already that are 8
characters and I need to change them to nine by adding a #8 to the
beginning of each entry... Any easy way of doing that??

\Bob

Jan 3 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
libadmin wrote:
I have a large database (for me) containing about 23,000 records and I
need to add a single digit (the number 8) to all data currently in a
specific field.. This field contains numbers already that are 8
characters and I need to change them to nine by adding a #8 to the
beginning of each entry... Any easy way of doing that??

\Bob
UPDATE TableName
SET FieldName = "8" & FieldName

(test on a copy of the table)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 3 '07 #2

P: n/a
"libadmin" <BA******@gmail.comwrote
>I have a large database (for me) containing about 23,000 records and I
need to add a single digit (the number 8) to all data currently in a
specific field.. This field contains numbers already that are 8
characters and I need to change them to nine by adding a #8 to the
beginning of each entry... Any easy way of doing that??
What's the data type of the field? It's not crystal clear to me from your
question. If it is, indeed, a text field containing numeric characters, Rick
has already answered your question. If it's a numeric field with eight-digit
numbers, then probably the simplest approach is to use the Cstr built-in
function to convert to a string, use Rick's suggested method of prepending
the character 8 to the number, then using Clng to convert back to Long
Integer.

Larry Linson
Microsoft Access MVP
Jan 3 '07 #3

P: n/a
if it is a number and NOT equal to 0 then ADD 80000000 to the number.

Ron

Jan 5 '07 #4

P: n/a
I was off by one

Add 800000000 to the number

Ron

Ron2006 wrote:
if it is a number and NOT equal to 0 then ADD 80000000 to the number.

Ron
Jan 5 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.