Hi all,
I want to concatenate a string in a query, it showing error following is query
SELECT CONVERT(VARCHAR(20), Month_date,106 )as tourdate , ' + @cols +' from (
select t.Month_date,b.bus_id,b.tour_date,b.[status],b.fare from #temp t left outer join Busdetails b on t.Month_date=b.tour_date
) x
pivot
(
max(status)
for bus_id in ( ' + @cols + ')
) p
order by Month_date
drop table #temp
error in second @cols
ie
max(status)
for bus_id in ( ' + @cols + ')
) p
there is no error in first line containing @cols
how to solve this
Regards
Baiju