Avatar of BenjaminWong
BenjaminWong

asked on 

How to insert zero into space

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)
Microsoft Server Apps

Avatar of undefined
Last Comment
Cakinci
ASKER CERTIFIED SOLUTION
Avatar of Cakinci
Cakinci

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft Server Apps
Microsoft Server Apps

Microsoft server applications are those applications developed specifically, but not necessarily exclusively, on the Windows Server platform. In addition to well-known products like SQL Server, Exchange, Internet Information Services (IIS), Microsoft Dynamics, Forefront, Lync and Sharepoint, they include applications like Skype, BizTalk, Hyper-V, Groove and Commerce Server. Server applications are managed with the Microsoft System Center.

12K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo