PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 3.00 average.

How to Convert Access Transform/Pivot Query for SQL Server

 
 
Charles Law
Guest
Posts: n/a
 
      20th May 2004
I have posted this on a couple of Access and SQL Server newsgroups, but with
no answer yet. There seems to be very little activity on the ones I have
looked at, so I thought I would post here as well, since I have no doubt
that many people here also use Access/SQL Server. Anyway, enough of my
rambling and on with the problem/question.

I have two queries that I use in Access:

<qrySelect>
SELECT table2.column1, table2.column2, table2.column3, table1.column4 FROM
table1, table2 WHERE table1.column1 = table2.column1
</qrySelect>

<qryResult>
TRANSFORM First(qrySelect.column3) AS FirstOfCode
SELECT qrySelect.column1, qrySelect.column4, First(qrySelect.column3) AS
[Total Of Code] FROM qrySelect GROUP BY qrySelect.column1, qrySelect.column4
PIVOT qrySelect.column2
</qryResult>

I now wish to use them against a SQL Server database but I am unfamiliar
with the equivalent construct of Transform/Pivot in SQL Server. I read in
the MS documentation that I should use ROLLUP on the GROUP BY clause, but
try as I might I cannot make it work.

Can any one suggest how this might be done?

If there is a better newsgroup to post this question in I would be grateful
if someone could point me in the right direction.

TIA

Charles Law



 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      22nd May 2004
Hi Charles,

I have checked which is the major SQL newsgroup and saw you had not placed
this message there.

It is not less smaller than the framework.aspnet newsgroup

Maybe you have a change there,

microsoft.public.sqlserver.programming

Cor


 
Reply With Quote
 
Charles Law
Guest
Posts: n/a
 
      22nd May 2004
Thanks Cor. I will try my luck there as well.

Charles


"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi Charles,
>
> I have checked which is the major SQL newsgroup and saw you had not placed
> this message there.
>
> It is not less smaller than the framework.aspnet newsgroup
>
> Maybe you have a change there,
>
> microsoft.public.sqlserver.programming
>
> Cor
>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      23rd May 2004
http://www.sqlteam.com/item.asp?ItemID=2955

Do you know this link, is from Google.

Cor


 
Reply With Quote
 
Charles Law
Guest
Posts: n/a
 
      23rd May 2004
Thanks Cor. That looks like a good solution. I will try it. I had searched
Google but didn't turn this one up. I can't have been looking for the right
thing :-)

Cheers.

Charles


"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> http://www.sqlteam.com/item.asp?ItemID=2955
>
> Do you know this link, is from Google.
>
> Cor
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transform/PIVOT Query carl Microsoft Access Queries 4 27th Apr 2011 06:11 PM
Access Query Transform.. Pivot to SQL Server Mastercafe - Juan Microsoft Access ADP SQL Server 3 20th Jun 2006 05:55 AM
How to Convert Access Transform/Pivot Query for SQL Server Charles Law Microsoft Access ADP SQL Server 3 27th May 2004 06:48 PM
Pivot and Transform not working in SQL Server subir.kumar@citigroup.com Microsoft Access ADP SQL Server 2 25th May 2004 02:34 PM
How to Convert Access Transform/Pivot Query for SQL Server Charles Law Microsoft Access Queries 0 20th May 2004 01:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:35 AM.