We help IT Professionals succeed at work.
Get Started

how do i zero fill numeric values based on a dynamic number input by the user?

amhinkel
amhinkel asked
on
320 Views
Last Modified: 2008-01-16
I have a table with string values and numeric values that I need to concatenate together.  The string value should go first then add 0's before the numeric value and concatenate to the string value.

maxbates table contains
prefix      varchar(255)
test

mysqltable contains

batesnum (numeric)    n_batesnum (varchar(255)
12345                          <null>
12346                          <null>
234567                        <null>
234568                        <null>
3456789                      <null>
3456790                      <null>

In a vb app, the user inputs that there should be 8 characters in the batesnum value so the final table
should look like this

mysqltable
batesnum   n_batesnum
12345         test00012345
12346         test00012346
234567       test00234567
234568       test00234568
3456789     test03456789
3456790     test03456790  


Thank you,

amhinkel
Comment
Watch Question
This problem has been solved!
Unlock 2 Answers and 2 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE