15,921,793 members
See more:
Sir i have a Sql Query:-

SQL
```select  [1] as  Jan,[2] as  Feb
from StudentDiscountItem
pivot (
sum (conP) for mnameid in ([1],[2])) as t
where studentid=3575 And Sessionid='20152016'```

Output of Query is :-

Jan -- Feb

20 -- 10

i need to add % sign with 10 and 20 like 10%,20%.

How can i do it.
Posted

## Solution 2

Not sure but I think one or both of the following two queries should do your job
SQL
```select  (cast([1] as varchar)+'%') as  Jan,cast([2] as varchar)+'%') as  Feb
from StudentDiscountItem
pivot (
sum (conP) for mnameid in ([1],[2])) as t
where studentid=3575 And Sessionid='20152016';```

If the above doesn't work, then try this
SQL
```select cast(Jan as varchar)+'%' as Jan, cast(Feb as varchar)+'%' as Feb
from (
select  [1] as  Jan,[2] as  Feb
from StudentDiscountItem
pivot (
sum (conP) for mnameid in ([1],[2])) as t
where studentid=3575 And Sessionid='20152016';
) as t```

Hope, it helps :)

TCS54321 9-Apr-15 2:32am
Its Working.. tnx
TCS54321 9-Apr-15 2:33am
boths are working
Suvendu Shekhar Giri 9-Apr-15 2:44am

## Solution 1

Try:
SQL
`SELECT CONVERT(VARCHAR(50), [1]) + '%' as  Jan...`

or (MS SQL Server 2012 and up):
SQL
`SELECT CONCAT([1], '%') as  Jan...`

[EDIT]
SQL
```SELECT CONVERT(VARCHAR(50), [Jan]) + '%' as  Jan...
FROM (
-- your pivot: SELECT [1] AS Jan...
) AS T```

Use the same logic for `CONCAT`.

v3
TCS54321 9-Apr-15 2:28am
No one working
TCS54321 9-Apr-15 2:30am
1)Error converting data type varchar to float
2)'CONCAT' is not a recognized built-in function name
This is the errors
Maciej Los 9-Apr-15 2:32am