Thank you for the reply, but again im already using dynamic fields.
For example:
DECLARE @columns VARCHAR(8000)
SELECT @columns = COALESCE(@columns + ',[' + cast(QuestionName as varchar) + ']', '[' + cast(QuestionName as varchar)+ ']')
FROM Answer A
INNER JOIN Question Q ON A.QuestionID = Q.QuestionID
INNER JOIN Customer C ON A.CustomerID = C.CustomerID
GROUP BY Q.QuestionName
SET @columns = '[CustomerID],' + @columns
DECLARE @query VARCHAR(8000)
SET @query = 'Some PIVOT query without aggregation'
EXECUTE(@query)
But i want to arrange the fields in @columns..i want 1 field to be 1st:
@columns = [f1],[f2],[f3].
What i want is like this:
@columns = [f2],[f1],[f3] :
Because one of the fetch data..is constant in my report.. and should be place in the beginning or the first row to be displayed.