AllI have a MS-Access database which is "out of proportion size", so it is decided to move the records to MS SQL Server (which I have never been used before). Also the frontend (MS-Access) will most probably be replaced. I now need to bring over my "Access Queries" to "SQL Views", but I am stucked with the Pivots.In Access, the SQL-code of one of such Crosstabquery isTRANSFORM Sum(qryData.[Events]) AS [SumOfEvents]SELECT qryData.Location, qryData.TypeFROM qryDataGROUP BY qryData.Location, qryData.TypePIVOT qryData.[Date D-M-Y];
but what is the syntax to use in a MS SQL View? Also note the Pivot is dynamically as "Date D-M-Y" are a variable amount of days. The output is something likeLocation Type 1/Apr/2011 1/May/2011 ... 1/Sep/2011Office 1 in 3000 5000 ... 1041Office 1 out 1060 1500 ... 120Office 1 rejected 100 70 ... 2065 Office 2 in 5000 1800 ... 145Office 2 out 1254 105 ... 10000Office 2 rejected 420 340 ... 354
...