0

I have a table with two columns (Date, Subject), I have created a query from it with three columns (MName, Subject, Counting) and also I have created a Dynamic crosstab query.

All of these I have done in MS Access easily.

My question is how can I create this 'Dynamic crosstab query' in SQL server.

My Table

Query

Dynamic Crosstab Query

Dale K
  • 21,987
  • 13
  • 41
  • 69
  • As per the question guide, please DO NOT post images of code, data, error messages, etc. - copy or type the text into the question. Please reserve the use of images for diagrams or demonstrating rendering bugs, things that are impossible to describe accurately via text. And please show what you’ve tried and tell us what you found (on this site or elsewhere) and why it didn’t meet your needs. – Dale K Apr 28 '21 at 11:25
  • Check out the discussion on [SQL Server dynamic PIVOT query?](https://stackoverflow.com/questions/10404348/sql-server-dynamic-pivot-query). That should give you some ideas of what to try. – Isaac Apr 28 '21 at 13:22
  • Does this answer your question? [SQL Server dynamic PIVOT query?](https://stackoverflow.com/questions/10404348/sql-server-dynamic-pivot-query) – Charlieface Apr 28 '21 at 14:40
  • Yes, It is. Please take a look at images I attached, I will be grateful if u Convert this access crosstab to sql server pivot – Nuzheen Kazim Apr 28 '21 at 15:35

0 Answers0