Click here to Skip to main content
15,890,361 members
Everything / Pivot table

Pivot table

pivot-table

Great Reads

by yuvalsol
Create professional-looking Excels (Filters, Charts, Pivot Tables) with EPPlus
by Gaurav_Chaudhary
This tip is a brief introduction to Pivot operator in SQL Server
by Sifiso W Ndlovu
This tip illustrates a workaround to SQL Server pivoting on variable character data types.
by B. Clay Shannon
The most straightforward way to add a Pivot Table to an Excel sheet based on data already on the sheet, using Excel Interop and C#

Latest Articles

by yuvalsol
Create professional-looking Excels (Filters, Charts, Pivot Tables) with EPPlus
by B. Clay Shannon
The most straightforward way to add a Pivot Table to an Excel sheet based on data already on the sheet, using Excel Interop and C#
by Sifiso W Ndlovu
This tip illustrates a workaround to SQL Server pivoting on variable character data types.
by Gaurav_Chaudhary
This tip is a brief introduction to Pivot operator in SQL Server

All Articles

Sort by Updated

Pivot table 

5 Oct 2016 by #realJSOP
I found this article on CodeProject (you could have found it if you had performed your own google search for the phrase, "C# pivot table"):C# Pivot Table[^]
4 Jun 2020 by #realJSOP
What you want to do is perform a "pivot" on your table. If you're doing in it in a MySQL Server view or stored proc, SQL Pivot in all databases: MySQL, MariaDB, SQLite, PostgreSQL, Oracle, …[^]
20 Nov 2014 by /\jmot
2 Jan 2013 by __TR__
Here is an approach without using PivotDECLARE @T TABLE (data VARCHAR(50), rowno INT, colno INT)---------------INSERT INTO @TSELECT 'abc', 1, 1 UNION ALLSELECT '12', 1, 2 UNION ALLSELECT 'xyz', 2, 1 UNION ALLSELECT '89', 2, 2--SELECT data, RowNo, ColNo FROM @TSELECT Col1,...
1 Jan 2013 by Aarti Meswania
I have data like below...data rowno colno---------------abc 1 112 1 2xyz 2 189 2 2now I want Outputcol1 col2------------abc 12xyz 89 How can i do this using pivot or any other way?please help :)
2 Jan 2013 by Aarti Meswania
I have solved ithope it will useful to them having same problemselect [1] as col1, [2] as col2 from tblPIVOT( max(data) FOR colno IN ( [1],[2] )) PivotTableHappy coding!:)
2 May 2019 by akash_95
I want to add an extend to this question. Let's say there is a table which will map the column names with actual names eg. in this case. 250 | emp1 | 251 | emp2 | 251 | Johny | 252 | Harry | and so on. And the column names should be (emp1,emp2,John,...) and not (250,251,252,....). Is there...
1 Apr 2014 by akhil.krish
my (access_event_logs) table[USERID] [TIMESTAMPS] [EVENTID]1 019 2014-03-06 07:50:48.000 IN 2 019 2014-03-06 17:02:39.000 OUT3 019 2014-03-09 07:43:37.000 IN 4 019 2014-03-09 14:34:59.000 OUT 5 019 2014-03-10 07:43:34.000 IN...
6 Apr 2014 by akhil.krish
this query give intime and outtime but i want total time and late time aslo....select distinct CE.USERID, CONVERT(Date,Localtimestamp) as LocalTime,(select min(TIMESTAMPS) from access_event_logs As MINCEwhere CAST(MINCE.TIMESTAMPS as DATE)=CAST(CE.TIMESTAMPS As DATE) AND...
1 May 2014 by Andrius Leonavicius
Maciej is right. PIVOT does the job.Here's the dynamic SQL version:DECLARE @ColumnsTable TABLE (col VARCHAR(10)); INSERT INTO @ColumnsTable (col)SELECT DISTINCT cidFROM src_table; DECLARE @Columns VARCHAR(MAX), @SQL VARCHAR(MAX); SET @Columns = (SELECT STUFF((SELECT...
7 Sep 2015 by Animesh Datta
Hello ,Refer :SQL - Pivot with Grand Total Column and Row
24 Mar 2013 by Anoop Jasiwal
select ID,oldid,[newid] from table1 as adp join table2 as CLN on cln.oldid = adp.id2or CLN.oldid = adp.IDID oldid newid2 1 1962 41 236i need the above tables with pivoting values as below,ID oldid newid oldid2 newid22 1 196 41 236can someone help in writing the...
7 Apr 2014 by ArunRajendra
Found few links. There are lot more if you google using "pivot in sql server 2012...
28 Jul 2015 by Avinash1310
SELECT meterid,transdatetime,[8] as [8 - 9],[9] as [9 - 10],[10] as [10 - 11],[11] as [11 - 12],[12] as [12 - 1],[13]as[1 - 2],[14]as[2 - 3],[15]as[3 - 4],[16]as[4 - 5],[17]as[5 - 6],[18]as[6 - 7],[19]as[7 - 8],[20]as[8 - 9] FROM(SELECT meterid, CONVERT(VARCHAR(10),...
27 Jul 2016 by B. Clay Shannon
The most straightforward way to add a Pivot Table to an Excel sheet based on data already on the sheet, using Excel Interop and C#
7 Apr 2014 by Bh@gyesh
Hi,Plase refer following link.Simple Way To Use Pivot In SQL Query[^]
29 Oct 2012 by BK 4 code
select * from (select ItemCode,Value1 from tbl_test) AS SourceTablePIVOT( max(Value1)FOR ItemCode IN ([Item1],[Item2],[Item3])) AS PivotTableUnionselect * from (select ItemCode,Value2 from tbl_test) AS SourceTablePIVOT( max(Value2)FOR ItemCode IN...
28 Apr 2014 by chaau
The problem is that you need to make sure that there is at least one record in your tblVisitTicket table for this query to work. If there are none the subquery you use for PIVOT source will return zero rows. The best way to fix it is to LEFT JOIN it with a fake numbers table that will contain...
7 Mar 2014 by CHill60
As per RyanDev's suggestion I'm posting this solution ...BulletVictim[^] said Quote:try two ' around the @fin_year(''+@fin_year+''))I responded Quote:Your error is in @sql. Can you post the output from the PRINT @sql command. BulletVictim is correct - you appear to missing single quotes...
30 Nov 2017 by CHill60
I usually do this by generating a list of the dates that I need (see Generating a Sequence in SQL[^] ) and then using that table in a LEFT JOIN to my actual data table. E.g. SELECT ....-- column list FROM MyListOfDates D LEFT OUTER JOIN biometricdata A ON D.DesiredDate = A.[DATE] -- or whatever...
4 Jan 2023 by CHill60
Another alternative is to create a pivot table with "Step" in the Columns selection, "Order" in the Rows selection and "Count of Step" in the Values selection. On my sample the pivot table is in columns F to K, rows 1 to 5 and looks like this ...
12 Jul 2013 by chimcham
This may not be the best answer but at least you can get an idea on how to work onyour report, and not using pivot.SELECT A.[Category], isnull(SUM([JANUARY]),'') as [JANUARY], isnull(SUM([FEBRUARY]),'') as [FEBRUARY], isnull(SUM([MARCH]),'') as [MARCH], ...
13 Feb 2014 by CoderPanda
This[^] should help. [Please accept/up-vote answers or solutions that work for you to encourage others]
4 Jan 2023 by Cody O'Meara
Hello! This is sort of hard to explain but I basically want Orders summarized to one row then move the step column to their own cells following the unique order number to form a single row. Here is an example to visually show it: Example Data: ...
7 Oct 2014 by Dharmendra Kumar Jain
Create Procedure spMonthScanReport (@Minth int, @Years int)asselect EMP_ID, [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], ...
23 Feb 2012 by Dharmenrda Kumar Singh
I Have an Excel Sheet where i had created an pivot table which is taking data from Sql Table.I am downloading that Excel sheet from an Application to Client machine and when we try to open it in clint machine, it is asking for the SQl Server Login Credentials.Is there any way so that after...
23 Feb 2012 by Dharmenrda Kumar Singh
I had solved by doing some manipulation .1. Create a user in SQl Server and give permission to that user for the desired database.2. Open Excel->Click on "Data" Tab3. Click on Existing Connection.A pop up will appear.4. On the top of the pop up wimdow, you find "Connections in this...
20 Dec 2012 by DinhCongLoc
Dear all,Please help me to resolve an issue for PivotTables such as:1. I have 2 PivotTable as: PVT1 in Sheet1, PVT2 in Sheet22. These PivotTable have same source and same Filter (Year, Quater).3. I would when i change Filter in PVT1, Filter of PVT2 is changed automaticallyPlease...
20 Dec 2012 by DinhCongLoc
Dear all,- I have sheet contain data as "DATA"- I have PivotTable (PVT1) from "DATA" with:+ Filter: Year, Quater+ Colume: Month+ Row: Location+ Value: Money- I also have PivotTable (PVT2) from "DATA" with:+ Filter: Year, Quater+ Colume: Location+ Row: Month+ Value:...
18 Jun 2013 by djapb
Hello all,I hope somebody may be able to help me with my problem. In a nutshell I am required to develop a Pivot / Cross Table Style Data Input Form. The description above might be enough for a response but if not i have tried to explain the problem in detail below. The Tables in...
7 Oct 2014 by DungVanNguyen
My table tblEmployeeScan(EMPLOYEE_ID varchar(7), ScannedTime)Everyday each employee scans 2 times, 1 time or 0 timeNow I want to crate store procedure Create proc spMonthScanReport@MONTH int,@YEAR intwhich returns a mothly report like belowEMPLOYEE ID 1 ...
16 Mar 2012 by Enkinger
Hi,I have DB in Sql. I want to show this results in gridview ( or similar something)Datagirdview shown us like excel pivot table. ( example is below)Every result is will be coming in sql DB.( We dont know Rowcount or column count or row and Column Name. İt is changing according to DB....
27 Oct 2014 by Er. Dinesh Sharma
HiPlease open the following linkStatic and Dynamic Pivot in SQL Server with out temp table[^]
11 Dec 2012 by farey2000
Regards,I have a table as below:create table #t (Factura varchar(15),ReciboCaja varchar(15),ReciboCajaValor varchar(15),)insert into #t values('1', '1', '1')insert into #t values('1', '2', '2')insert into #t values('1', '3', '3')insert into #t values('2', '4',...
7 Feb 2015 by Gaurav_Chaudhary
This tip is a brief introduction to Pivot operator in SQL Server
13 Feb 2014 by GauravThorat
Hi all,I wanted to Call Stored Procedure using Entity Framework,SP is using Pivot and #Temp table and returning distinct and different columns run time.Now the problem here is, when I am adding SP as using Function Import, and clicking on Get Column Information it is giving me "The...
13 Feb 2014 by GauravThorat
I have set all Adhoc query Options and called the required sp in another sp like SELECT *FROM OPENQUERY([Server], 'SET NOCOUNT ON; EXEC [DB].[dbo].SP ''33''')Now I wanted to get pass the 33 which through parameter like SELECT *FROM OPENQUERY([Server], 'SET...
13 Jul 2013 by Hammad Raza
I have 2 tables revenue and expense Table: Revenue------------------------------------------------------transactionID | transactionDate | Branch | TotalAMount------------------------------------------------------1 | 2013-01-01 | MC |...
13 Jul 2013 by Hammad Raza
SELECT er.category `Category`, SUM(IF(transactionDate between '2013-01-01' and '2013-01-31', r.totalamount, 0)) Jan, SUM(IF(transactionDate between '2013-02-01' and '2013-02-31', r.totalamount, 0)) Feb, SUM(IF(transactionDate between '2013-03-01' and '2013-03-31', r.totalamount, 0))...
17 Mar 2012 by Herman<T>.Instance
Hey Enkinger,read my article[^] about dynamic pivots in sql
11 Dec 2012 by Herman<T>.Instance
read my article here[^] on CodeProject.Has explanation, samples etc.
2 Jan 2013 by Herman<T>.Instance
Read my article about dynamic pivotting here[^]
12 Oct 2020 by houssem eddine ayari
Hello, I tried to make an excel PivotTable with C# windowsForm. I need to get data from SqlServer but nothing is written on my Excel file. What I have tried: private void button2_Click(object sender, EventArgs e) { string...
12 Oct 2020 by houssem eddine ayari
private void button2_Click(object sender, EventArgs e) { Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; object misValue =...
23 Oct 2014 by Hugo Dionicio Albornoz
Can anyone help me with the sum of two tables with a dynamic pivot.tables: horas_trabajadas equ_codigo | tur_codigo | con_fecha | hor_tra_horas horas_paradas equ_codigo | tur_codigo | con_fecha | hor_par_hora Add hours to be the same code and corresponding to the same...
27 Aug 2013 by iCanDivideByZero
Does anyone know how to convert the following into a table: This is results is yielded from executing a stored procedure (EXEC [dbo].[sp_GetSomeData] +@DataID+ FOR XML RAW) and I want to take the results produced and put it into a...
26 Jun 2012 by JakirBB
I have a table with data as follows.Name Size----------------A 1B 2C 1D 1E 3F 2I have to write an SQL (sql server) which will return 3(as there are 3 types of sizes are in the table) tables. The number of produced...
24 Nov 2016 by jamuro77
Hi, I recently wrote an article talking about this. You can check it at Using PIVOT with SQL Server[^] I hope it works for you!
18 Aug 2014 by jayeshhh
I have a table Structure Like this :EdpNo FullName PeriodMonth ITaxAmount EduCess 16 RAJ KISHORE SHAW 4 1809 5416 RAJ KISHORE SHAW 5 1812 5416 RAJ KISHORE SHAW 6 3185 9516 RAJ KISHORE SHAW 7 0 016 RAJ KISHORE SHAW 8 0 016 RAJ...
13 Feb 2014 by joginder-banger
try this linkhttp://stackoverflow.com/questions/209383/select-columns-from-result-set-of-stored-procedure?rq=1[^]
4 Apr 2013 by Kenneth Haugland
Since you gave the VBA code im going to assume that it can be done this way: Excel.Application oXL; Excel._Workbook oWB; Excel._Worksheet oSheet; Excel.Range oRng; try { //Start Excel and get Application object. oXL = new Excel.Application(); oXL.Visible =...
13 Jun 2015 by Kunal Ved
I get this error when I use Pivot operator Msg 102, Level 15, State 1, Line 3Incorrect syntax near '('.CREATE TABLE BookSalesTable(BookType VARCHAR(20), SalesYear INT, BookSales Int);SELECT *FROM BookSalesTable PIVOT (SUM(BookSales) FOR SalesYear IN([2013], [2014]) ...
14 Sep 2015 by Leo Chapiro
Yes, it is possible, take a look at How to View and Analyze an OLAP Data Cube with Excel :Quote:To view and analyze an OLAP data cube with Excel 1. In the Service Manager console, click Data Warehouse, expand the Data Warehouse node, and then click Cubes. 2. In the Cubes pane,...
30 Oct 2012 by Maciej Los
lease, have a look at below example:CREATE TABLE #MyTable(mDate DATETIME, mPID INT, mBUID INT, mUID INT, mDescription NVARCHAR(30), mTime INT)INSERT INTO #MyTable (mDate, mPID, mBUID, mUID, mDescription, mTime)VALUES('7/30/2012', 323, 1, 106, 'Code', 95)INSERT INTO #MyTable (mDate,...
18 Nov 2013 by Maciej Los
Meluzin (Tomas) wrote:(...) the application is an MS excel Add-in and should be able to create the pivot table on the data which is read from backend system. So the process is following:* firstly data is read from backend system (based on user's selection)* at runtime, I create the MS Access...
9 Mar 2014 by Maciej Los
If you don't want use SQL pivot[^], i'd suggest to use Linq[^].LINQ Pivot, or Crosstab, Extension Method[^]Pivot table in LinQ to entity[^]Is it possible to Pivot data using LINQ?[^]
1 Apr 2014 by Maciej Los
Please, see my comment to the question.Try it:SELECT userid, [IN], [OUT]FROM ( SELECT * FROM access_event_logs ) AS DTPIVOT(MAX(timestamps) FOR eventid IN ([IN],[OUT])) AS PTIf [total] means the difference in hours, try it:SELECT userid, [IN], [OUT],...
28 Apr 2014 by Maciej Los
Change it to:SELECT VisitID, VisitDate, IssuedBy, VisitPurpose, CompanyName, SPname as 'SalePerson', [1] as 'Person 1', [2] as 'Person 2', [3] as 'Person 3'FROM (SELECT VisitID, VisitDate, IssuedBy, VisitPurpose, CompanyName, SPname, [1], [2], [3] FROM ( SELECT TD.VisitID,...
1 May 2014 by Maciej Los
Pivot should works perfect! Static version:SELECT Trm_id, agt_id, nk_id, cid_10, cid_11, cid_12FROM ( SELECT t1.Trm_id, t1.agt_id, t1.nk_id, t1.cid, 'cid_' + CONVERT(VARCHAR(10),t1.cid) AS ColHeader, t1.valueid, t2.value_desc FROM src_table AS t1 INNER JOIN reference_table AS t2 ON...
7 Oct 2014 by Maciej Los
Please, read my comment to the question.You need dynamic pivot which generates as many column as many days is in a month:Dynamic PIVOT in Sql Server[^]pivots with dynamic columns in sql server 2005/[^]Script to create dynamic PIVOT queries in SQL Server[^]Use SearchBox on the...
6 Nov 2014 by Maciej Los
I'd like to say that you're able to achieve almost the same functionality what Excel does have. Let's say, you need to create editable gridview. That's all!It's bad idea to use third party application (like Excel), because of many factors:1) you can't (fully) control it,2) you need to...
9 Apr 2015 by Maciej Los
Here is an idea: PIVOT and UNPIVOT[^]Simple Way To Use Pivot In SQL Query[^]Pivot tables in SQL Server. A simple sample.[^]PIVOT and UNPIVOT in Sql Server[^]
29 Jun 2015 by Maciej Los
This functionality is available starting from Excel 2010. See: Overview of PivotTable and PivotChart reports[^]
7 Sep 2015 by Maciej Los
The logic is: SELECT T.*, ([2015-08-01] + [2015-08-02] + [2015-08-03]) AS TotalFROM (-- your dynamic query) AS Twhere [2015-08-01] + [2015-08-02] + [2015-08-03] commes from @columns variable ;)Get it?
5 Oct 2016 by Maciej Los
There's few ways to achieve that:1) using ExcelCreate a PivotTable to analyze external data - Excel[^]Excel - Create a Pivot Table Using SQL - Spreadsheets Made Easy[^]Create Excel Pivot Table from SQL Server | Go Beyond Excel[^]2) using C#Creating a PivotTable Programmatically –...
27 Feb 2020 by Maciej Los
You need to use ORDER BY clause[^]. SELECT * FROM ( SELECT CurrCode, YEARNO, Monthno, TOTALAMOUNT FROM [dbo].[ML_tbl_Analaysis] where Currcode =@CURRCODE ) tbl PIVOT (sum(TOTALAMOUNT) FOR [yearno] IN...
29 Mar 2020 by Maciej Los
Yes, it is possible to achieve that on squery level. See: Using PIVOT and UNPIVOT - SQL Server | Microsoft Docs[^] Then... in c#: 1. Open SqlConnection[^] 2. Create SqlCommand[^] (with pivot query) 3. Create SqlDataReader[^] by calling...
18 Aug 2014 by Magic Wonder
Hi,Check this...Simple Way To Use Pivot In SQL Query[^]Hope this will help you.Cheers
17 Mar 2013 by Maideen Abdul Kader
My Problem:my store procedure have dynamic column. so i cannot insert into tabe.so i need to export directly to excel. Below is my code. Below code is working fine.i need either export excel directly from store procedure or how can i create dynamic table with store procedurePls help...
27 Feb 2020 by Maideen Abdul Kader
Hi I have an issue that I could not sort/order by Month or monthno in pivot. Please advice me Thank you Maideen here is my code What I have tried: SELECT * FROM (SELECT CurrCode,YEARNO,Monthno,TOTALAMOUNT FROM [dbo].[ML_tbl_Analaysis]...
14 Nov 2013 by Meluzin
Hello experts,I am struggling with an issue on how to create pivot table with data taken from an external source - an existing MS Access database. The database can be opened in MS Access withou any problems and the data is available there.I found 3 similar ways on how to implement it,...
24 Nov 2013 by Meluzin
So finally, rewritting the code into ADO helped.Here is the ADO coding.Firstly, Access DB is created. There is one trouble with this - simple ADO cannot do this, therefore, you have to use additional extension component ADOX (Microsoft ADO Ext. x.x for DDL and Security) - more details...
14 Sep 2015 by Member 10040153
I am working on pivot grid to show my OLAP cube data.I had made it in web form but want Cube fields tree in excel (excel add in using c#) by which I can drag and drop fields and labels from tree to excel.Is it possible?I want to place a tree control in C# excel add in and bind it with my...
30 Aug 2013 by Member 10242495
Division SalesOfficeDescr. ValueBeforeTAX30 Vijayawada 213410 Ahmedabad 339.510 Bangalore 216020 Bangalore 66666.610 Kochi 1150the above data i want see as SalesOfficeDescr. 10 ...
16 Aug 2017 by Member 10501509
Explain pivot and give few examples.
3 Sep 2015 by Member 10976343
In c# Excel Add-In I want to find out the true background color (CELL PROPERTIES BACK_COLOR) of the values from MDX query. Not the color of the cell from Pivot tables, which can be changed manually.
14 Sep 2014 by Member 11031380
I have a ListView (or GridView) draft table like this:https://www.dropbox.com/s/dnvwjx79kfrsq44/01.JPG?dl=0[^].JPG?dl=0">https://www.dropbox.com/s/dnvwjx79kfrsq44/01.JPG?dl=0[^]My SQL Server table has the following fields:- UPC (bigint)- Description (varchar)-...
29 Jun 2015 by Member 11800543
Hi,As per my requirement, I have one excel sheet with table having 10 columns.From that table, i created one Pivot Table using three of its columns.I want a solution to Refresh the Pivot Table automatically when I filter the source table.Note: No Macros are allowed.Thanks In...
14 Aug 2015 by Member 11898509
I have a table enroll like this-Students Class1 Class2 Class3student1 1 0 1student2 0 1 0student3 1 ...
14 Aug 2015 by Member 11898509
Solution is-create or replace procedure test_studentsascursor c_colsisselect column_namefrom user_tab_columnswhere table_name = 'STUDENTSENROLL'and column_name != 'STUDENTS';l_number_of_students number;l_my_col user_tab_columns.column_name%type;l_statement...
28 Dec 2015 by Member 12232845
I have a pivot table which I need to import into SAS EG. But this pivot table has values coming from database and few values are entered manually. When I tried to import this pivot table to SAS ., only the values from database got imported. the manual values were not imported into...
22 Apr 2016 by Member 12464468
Dear experts,Could anybody advise me how to create a pivot table in Excel using C++ (not using MFC or #import)? In particular, how Range should be defined to be properly passed into IDispatch::invoke(...) function on a stage of PivotCach object creation? In VB it looks like: Dim...
2 May 2019 by Member 12658789
USE AdventureWorks2014;SELECT *FROM( SELECT VendorID, EmployeeID FROM Purchasing.PurchaseOrderHeader) AS PURPIVOT( COUNT(EmployeeID) FOR EmployeeID IN ("250", "251", "256", "257", "260")) AS PVTWhat I have tried:I'm not sure what to try as I'm very new to SQL.
30 Nov 2017 by Member 13264296
As we know that the record will stored to the database if there is a transaction on that date. But if there is certain date that we had no transactions, No date of transactions will be keep on record to the database. Now, I will make a report, I need to display the dates including no...
17 May 2018 by Member 13721474
I have to create the table in excel from the existing datatable and need to create a pivot table for the given column in the tale . What I have tried: I have the datatable and I don't know how to proceed
2 Nov 2018 by Member 14041654
I'm getting output for pivot xml as 2018-10-291252018-10-30122018-10-311 ...
6 Dec 2018 by Member 14080105
I have an Excel sheet that has a pivot table in it. This pivot table pulls its data from a table that I have no other access to. I need to upload this data into a MySQL table on a daily basis. The part that will take the pivot table and upload it to MySQL works perfectly. The problem is that...
5 Jun 2020 by Member 14852988
Hello, I have a uestion regarding my SQL Code. My goal is it to switch rows to columns. ID | NAME | POINTS| DATE ----------------------------------- 1 | KARL | 2 | 2020-05-15 2 | EVA | 0 | 2020-05-15 3 | OTTO | 5 | 2020-05-15 4 | KARL | 3 |...
5 Jun 2020 by Member 14852988
Hello, sorry for the wrong posting. I tried the hole day and I think I found what I am looking for. SELECT id, name, team, MAX(CASE WHEN datum = DATE_SUB(CURDATE(), INTERVAL 4 day) THEN points END) 4tage, ...
20 Mar 2012 by Member 7851700
I've spent significant amount of time looking around, however couldn't really find any solution to this:I've got 4 tables: Category(id,Name),Product(id,Name,CategoryID),RatedProducts(id,Rating,ProductID,UserID), User(id,Name) Category1 Category2 ...
21 Mar 2012 by Member 7851700
Thanks, var result = from r in smdt.SM_RatedProducts group r by new { r.SM_Product.Name, UserName = r.SM_User.Name, Category = r.SM_Product.SM_Category.Name, r.Rating } into prodGroup orderby prodGroup.Key.UserName ascending orderby...
2 Apr 2012 by Member 7851700
Gents, I'm trying to create a dynamic pivot gridview table capable of updating on the fly. I managed to populate the whole lot from my DB but what do I do if I want the user to have a number of dropdowns/textboxes so they can narrow down the result. EDIT:_dtProjects =...
20 Nov 2014 by Member 9129971
I am using asp.net mvc 5,entity frmework 5, linqi have following tables:order: 1. orderid customerid 1 2 2 3 3 1orderDetail: orderid productname quantity 1 A ...
4 Apr 2013 by MK-Gii
Hello Guys :)I got another issue with C# - I am looking for a way of collapsing pivot table fields. Generally situation is as follows:http://i45.tinypic.com/cnx37.jpg[^]I know that in VBA it can be done by this peace of...
19 Jun 2013 by MohamedKamalPharm
take a look on this article, my helpSimple Way To Use Pivot In SQL Query
27 Aug 2013 by Muhammad Kashif Saleem
Try This : May help this http://stackoverflow.com/questions/13707938/sql-server-pivot-table-transform-row-into-columns[^]http://forums.asp.net/t/1870891.aspx/1[^]
24 Nov 2016 by munirshaikh
I have a Dynamic PIVOT query in which Columns are dynamically generated.My table: ATTENDANCE_MASTER Contains: ID, Stud_id, ATT_DATE, PRESENTwhich stores data like:ID Stud_id ATT_DATE PRESENT1 1 2015-08-1 12 2 2015-08-1 03 3 2015-08-1 14 ...
30 Aug 2013 by Nelek
Since you didn't ask any question, it is difficult to give you a better answer.I strongly recommend you to read: How to ask a question[^] and What have you tried?[^]P.S. Written as solution to avoid this "question" to be in the unanswered list
9 Mar 2014 by Parth Dotnet1
I got stuck at a place while making attendance application. VB.GUYS CAN SUGGEST ME QUERY FOR FOLLOWING . NO STORE PROCEDURE PLEASE, I have a table in my sql database.2 columns , name and dates.NAMES | DATES abc 1-1-2014 abc 2-1-2014 cde ...