Hi,
I want to format the data as below for a report.
here is just a sample of what i am doing...
what i want is if the 'Header_1' has '%' then i want to convert [Month_1] values as int.
any idea why the above code doesn't work?
Thanks!!
I want to format the data as below for a report.
here is just a sample of what i am doing...
Code:
create table #test
(Header_1 varchar(20),
Month_1 numeric(10,2))
;
insert into #test values('Sales',120)
insert into #test values('Sales%',2.45)
;
select case when charindex('%',[Header_1])=0 then cast ([Month_1] as int)
else [Month_1] end
from #test
what i want is if the 'Header_1' has '%' then i want to convert [Month_1] values as int.
any idea why the above code doesn't work?
Thanks!!