I am unable to use Pivot
in SQL server due to some compatible issues, so I am trying do same thing in code level by using LINQ TO SQL.
I have a record set as like below.
Dates RM DM LocationNum City State Count
----- -- -- ----------- ---- ----- -----
2013-12-13 1 1 4795 Grapevine TX 1
2013-12-13 1 2 4796 Grapevine TX 1
2013-12-14 2 3 4797 Grapevine TX 1
2013-12-15 NULL NULL NULL NULL NULL 0
2013-12-16 NULL NULL NULL NULL NULL 0
I am trying to convert this in
RM DM Loc City 2013-12-13 2013-12-14 2013-12-15 2013-12-16
-- -- --- ---- ---------- ---------- ---------- ----------
1 1 4795 City1 1 0 0 0
1 2 4796 City2 1 0 0 0
1 3 4797 City3 0 1 0 0
Can any one help me in this.