Click here to Skip to main content
15,890,282 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 Title

Pivot table 

23 May 2018 by yuvalsol
Create professional-looking Excels (Filters, Charts, Pivot Tables) with EPPlus
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...
29 Jun 2015 by Maciej Los
This functionality is available starting from Excel 2010. See: Overview of PivotTable and PivotChart reports[^]
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...
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...
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 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 CoderPanda
This[^] should help. [Please accept/up-vote answers or solutions that work for you to encourage others]
13 Feb 2014 by joginder-banger
try this linkhttp://stackoverflow.com/questions/209383/select-columns-from-result-set-of-stored-procedure?rq=1[^]
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...
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 Oct 2014 by Er. Dinesh Sharma
HiPlease open the following linkStatic and Dynamic Pivot in SQL Server with out temp table[^]
1 May 2014 by pratap420
Hi all,Could any one help me for below requirementI have two table like this src_table Trm_id agt_id nk_id cid valueid t1 a1 n1 10 101 t2 a2 n2 10 101 t3 a3 n3 10 102 t1 a1 n1 11 ...
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...
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...
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...
18 Aug 2014 by Magic Wonder
Hi,Check this...Simple Way To Use Pivot In SQL Query[^]Hope this will help you.Cheers
29 Mar 2020 by smodak@ats360.com
Hi, I wanted to implement the excel like pivot table functionality using SQL query. Is there any technical approach to achieve this functionality on the query level? Also is it possible to implement using C#.net code? Thanks What I have tried:...
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...
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 Jan 2013 by Herman<T>.Instance
Read my article about dynamic pivotting here[^]
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,...
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 ...
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?[^]
10 Apr 2014 by Tomas Takac
I didn't understand much from what you have written, but here is the query that gives the desired output. I like to work in steps using CTEs.declare @intime time = '8:30'declare @outtime time = '14:30';with dates as( select cast([TIMESTAMPS] as date) as [date], * from...
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 |...
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, …[^]
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...
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: ...
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 ...
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...
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...
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...
17 Mar 2013 by Prasad Khandekar
Hello,I will suggest that let this stored procedure return a resultset and use it to create an Excel file. Simplest way will be create a CSV file. Here[^] is some code to get you started.Regards,
5 Nov 2014 by SurbhiA
Hi, I want to export the c# datatable to excel pivot table.The exported pivot table should be editable means user can edit values in pivot cells.The changed value must automatically be reflected in grand totals.I want this using c#.Can anyone help?Thanks,Surbhi
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...
15 Sep 2016 by VAIBHAV PANDYA
Hello Everyone,I have a excel sheet containing too much raw data. Now I want to change the representation of the data in specific format in another Excel sheet in same workbook using Pivot Table facility.As of now to represent the data in required format I am doing few manual steps in...
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 ...
20 Nov 2014 by /\jmot
2 Nov 2018 by Member 14041654
I'm getting output for pivot xml as 2018-10-291252018-10-30122018-10-311 ...
9 Apr 2015 by sambasiva.g
ID ColumnName ColumnValue Deal...
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[^]
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...
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,...
6 Mar 2014 by sachi Dash
Firstly I get a dataset through a query from database.then i convert this dataset into Json string.By using ajaxcall i get this Json string in my clint side.Now I need to prepare this string through javascript in my clint side.Then I will show this string in a pivot table?I...
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.
28 Jul 2016 by Patrice T
You should really read the web pages where you found your sample code.SQL Aliases[^]PIVOT and UNPIVOT in Sql Server | SqlHints.com[^]Using PIVOT and UNPIVOT[^]
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...
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...
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...
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...
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...
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#
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...
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],...
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
17 May 2018 by Richard MacCutchan
See Microsoft.Office.Interop.Excel namespace ()[^].
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...
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[^]
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 –...
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,...
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...
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...
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 ...
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...
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], ...
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]...
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...
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)-...
28 Oct 2012 by sruthyharidas
I am Having a Result Set Like ThisItemCode Value1 Value2 Value3 Value4Item1 1 2 3 4Item2 5 6 7 8Item3 9 10 11 12I need to convert this table to following formatItem1 Item2 ...
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...
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 ...
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
30 Aug 2013 by phil.o
I would add to the first (perfectly valid) solution of Nelek this link :SQL pivot table[^]which will lead you to about 762,000 results on this topic.Good reading!
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 Jun 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Perfectly works for me. See the SQLFiddle - http://sqlfiddle.com/#!3/b82c6/1/0[^].
13 Jul 2013 by Hammad Raza
I have 2 tables revenue and expense Table: Revenue------------------------------------------------------transactionID | transactionDate | Branch | TotalAMount------------------------------------------------------1 | 2013-01-01 | MC |...
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 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))...
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 =...
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...
19 Jun 2013 by MohamedKamalPharm
take a look on this article, my helpSimple Way To Use Pivot In SQL Query
7 Feb 2015 by Gaurav_Chaudhary
This tip is a brief introduction to Pivot operator in SQL Server
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',...
11 Dec 2012 by Herman<T>.Instance
read my article here[^] on CodeProject.Has explanation, samples etc.
7 Nov 2012 by sayedalishakeel
Hi All,Need to pivot the given data Key colName ColVal8213392 CallSign 1a2348213392 Date 1a2348308862 CallSign A8KD48308862 Date 21-Sep-068322662 CallSign 1a2348322662 Date 1a2349015905 CallSign 1a2349015905 Date 1a234The...
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),...
22 Feb 2016 by Sifiso W Ndlovu
This tip illustrates a workaround to SQL Server pivoting on variable character data types.
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:...
16 Aug 2017 by Member 10501509
Explain pivot and give few examples.
7 Apr 2014 by Bh@gyesh
Hi,Plase refer following link.Simple Way To Use Pivot In SQL Query[^]
7 Apr 2014 by ArunRajendra
Found few links. There are lot more if you google using "pivot in sql server 2012...
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...