troubleshooting Question

How to insert zero into space

Avatar of BenjaminWong
BenjaminWong asked on
Microsoft Server Apps
1 Comment1 Solution291 ViewsLast Modified:
Hi expert,
I need to run a sql scrip to join 2 fields in a new field called customerno.  The customerino is a 8-digit field starting with Alphabet ranging from 1 to 3, and is followed by 5 numeric.  Any space between Alphabet and numeric should be filled with zero; example below:
    customerno F0000567,
    customerno FA001234,
   customerno :FAS12345
   customern0 :F0000004

I used the following scrip but I could not get the result I want, any pointers?:

set customerno=left(Prefix,3)+right(counter,5)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros