Chance1234
IS-IT--Management
Code:
up_client_plan_create_unique_ref
@planid as int,
@client as int
AS
declare @int int
declare @plan varchar(50)
declare @planLead char(1)
declare @num varchar(50)
set @plan = (SELECT plan_inland_revenue_ref from [plan] where plan_ident = @planid)
set @planLead = (SELECT plan_leadref from [plan] where plan_ident = @planid)
set @int= (SELECT plan_clientcount from [plan] where plan_ident = @planid) + 1
set @num = cast(@int as varchar(10))
select @plan,@int,@plan + '/' + ISNULL( @planLead, '') + replicate('0', 4-len(@num)) + @num
I have the following SP
the data in table plan looks like the following
plan_ident , plan_inland_revenue_ref,plan_clientcount,plan_leadref)
1,'ABCDEF',22,NULL
2,'GHIKKL',40,'T'
What IOm hoping the result to look like is the following
where planid = 1
ABCDEF/23
Where planid = 2
GHIKKL/T41
The second part is working,but i get a space after the Dash
ie
ABCDEF/ 23
Chance,
F, G + HH