Solved

PIVOT works fine for MsAccess - Now I am converting to MSSql - How please?

Posted on 2011-02-20
5
281 Views
Last Modified: 2012-05-11

this PIVOT works fine for MsAccess - Now I am converting to MSSql - How would I do this  please?

TRANSFORM Sum(AceData.InCredit) AS SumOfInCredit
SELECT AceData.Type
FROM ListJob INNER JOIN AceData ON ListJob.JobList = AceData.Job
WHERE (((ListJob.ScenarioAccountant)=True))
GROUP BY AceData.Type
PIVOT AceData.Job;
0
Comment
Question by:goodk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
borki earned 250 total points
ID: 34938789
Which version of SQL Server? Pivot is one of the areas that have been improved in the last few versions of MS SQL.

Here is one method that I have used with SQL 2000:
http://www.sqlteam.com/article/dynamic-cross-tabs-pivot-tables

In SQL 2005 and beyond you have the PIVOT statement, which is nowhere near as convenient as the TRANSFORM in Access. There are some good articles out there, start with:
http://www.kodyaz.com/articles/t-sql-pivot-tables-in-sql-server-tutorial-with-examples.aspx

Good luck
0
 

Author Comment

by:goodk
ID: 34962623
sql 2008

Microsoft SQL Server Management Studio                                    10.0.2531.0
Microsoft Data Access Components (MDAC)                                    6.0.6002.18005
Microsoft MSXML                                    3.0 4.0 5.0 6.0
Microsoft Internet Explorer                                    8.0.6001.19019
Microsoft .NET Framework                                    2.0.50727.4206
Operating System                                    6.0.6002
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 250 total points
ID: 34962692
Just so we are clear, can you post exactly what happens if you run the SQL you posted in SQL Server?
Also state the version of SQL Server you are using.

See here:
http://msdn.microsoft.com/en-us/library/ms177410.aspx

Or see this utility:
http://www.rac4sql.net/


JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34962701
<Also state the version of SQL Server you are using.>
...never mind, you already did that...

;-)
0
 

Author Closing Comment

by:goodk
ID: 34988524
partial
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question