Hi
I am currently migrating a C# application from using an MS Access backend to an SQL database. I have run into a bit of problem as of one of my queries is a TRANSFORM / PIVOT with the columns being an unknown number. Does anybody know how to convert the following into the SQL Server equivalent with the PIVOT being dynamic. I have looked at several examples but they all seem to suggest that a stored procedure is required.
TRANSFORM Count(EnquiryActionHistory.RecordGuid) AS CountOfRecordGuid
SELECT (CreatedBy) AS Officer, Count(EnquiryActionHistory.RecordGuid) AS Total
FROM SystemUser INNER JOIN EnquiryActionHistory ON SystemUser.FullNameAndPI = EnquiryActionHistory.UpdatedBy
WHERE ManagersPINumber = '1111111' AND ((DateActionCreated&TimeActionCreated) Between '201408201406' AND '201508201406')
GROUP BY EnquiryActionHistory.CreatedBy, SystemUser.ManagersPINumber
PIVOT ActionType
Thanks in Advance
Pavros