Hi All, I need to bind the table data in gridview with some alteration. I have table like below Table structure Application 1-NA RED Comment Application 1-LN Amber Comment Application1 -ZU Green Comment Application 1-NA RED Comment Application 1-LN Amber Comment Application1 -ZU Green Comment I want to cut the application name and want to put as a separate column (heading) and rest of part as region. And bind it with datagrid. Logic or sample of code would be appreciated. I am looking for gridview like below Application 1 NA Red Comment LN Amber Comment ZU Green Comment Application 2 NA Red Comment LN Amber Comment ZU Green Comment
abhi291984
Posts
-
Problem with gridview -
complex sql querycreate table #table (affected item varchar, LN int, NY int, Zu int) insert(table) select Affected item,SUM( case region when 'LN" then 1 else 0) LN,SUM( case region when "NY" then 1 else 0) NY,SUM( case region when 'ZU" then 1 else 0) ZU from tablename groupby affected item please advice if i am wrong? Thanks, Abhishek
-
complex sql queryHi Rah, Thanks for the article,I am trying but as I am not the database resource so it will take the time.. I am learning now how pivote works.... but it is urgent for me as i have to demo of project tomarrow,, can u provide me the query on urgent basis..... Thanks in advance, Abhishek
-
complex sql queryHi, Apologize if you did not understand my problem..I am describing it again.. I have table which having four column,falconid,priority,affected item and region. falconid is primary key,priority shows how much critical is problem,affected item shows which application is affecting and user is facing problem,region shows the different time zone multiple user is raising the tickets from different zone with respect to affected item.that all will save in single table. like below.. falconid priority affecteditem region 1 1 textbook ny 2 1 database ln 3 2 textbook ln 4 1 database zu 5 2 coin ny 6 2 textbook zu Now I want to calculate at the end of the day,that how many ticket(count*) has been raise for the particular affected item from which zone.. in table there are 3 ticket for textbook but from different region I want to calculate the number of ticket raised from different region on affected item wise..like below affecteditem ln zu ny textbook 1 1 1 database 1 1 0 coin 0 0 1
-
complex sql queryHi All, I am looking for query which needs two group by.. table looks like--- falconid priority affecteditem region 1 1 textbook ny 2 1 database ln 3 2 textbook ln 4 1 database zu 5 2 coin ny 6 2 textbook zu now i want to result sorted by affected item and then count(*) according to region base in set like so that i can count how many ticket opened region vise.. affecteditem ln zu ny textbook 2 1 0 database 1 1 0 coin 0 0 1 Thanks, Abhishek