Solved

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

Posted on 2011-02-20
5
283 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

726 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