?
Solved

Add digit to a number

Posted on 2006-04-17
5
Medium Priority
?
361 Views
Last Modified: 2012-06-21
I have a field with an 18 digit number.  I need to add a 0 in the 9th digit making it a 19 digit number.

Example:
111111111111111111
becomes
1111111101111111111

Is there an easy way to do this with a SQL update query?
0
Comment
Question by:parkcityit
  • 3
5 Comments
 
LVL 19

Expert Comment

by:dmitryz6
ID: 16470425
left([Yourfield],8) & "0" & mid([Yourfield],9)
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 16470434
MyNewNumber = left(CStr(MyOldNumber, 8)) & "0" & right(CStr(MyOldNumber, 10))

Is this value stored in a table.column that is Text or numeric?
0
 
LVL 19

Accepted Solution

by:
dmitryz6 earned 2000 total points
ID: 16470438
UPDATE tblName SET Yourfield = left([Yourfield],8) & "0" & mid([Yourfield],9)
0
 

Author Comment

by:parkcityit
ID: 16470485
That was ridiculously fast.
0
 
LVL 19

Expert Comment

by:dmitryz6
ID: 16470520
You welcome
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question