Hi All,
I am trying to create a pivot query using the below test data
My table looks like
City Group agent paymentdate actno
Chennai South X1 05/01/2018 .1
Bangalore south D1 05/02/2018. 2
Delhi. North C1. 05/02/2018. 3
Chennai. South. B1. 05/01/2018. 4
Chennai . South. X1 . 05/01/2018. 5
I am trying to get the output as below
City Group agent 05/01/2018 05/02/2018 05/03/2018
Chennai south X1 2. 0. 0
Bangalore south D1 0. 1. 0
Delhi. North . C1. 0. 1 0
Chennai South . B1. 1 . 0 . 0
Note : Date will dynamic for the month. I have to display data for the month
I tired with PiVot but I have to hardcode the value in for In clause.
How to pass it as dynamic? Or is there any other way to achieve this?
Thanks in advance.
Cheers
San