Pivot Query
From: Subir Kumar (anonymous_at_discussions.microsoft.com)
Date: 06/10/04
- Next message: Smith: "Changing 100 table object owner names at once"
- Previous message: anonymous_at_discussions.microsoft.com: "Dynamic SQL and IN list - Thanks!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 10 Jun 2004 06:36:53 -0700
Hi,
I am migrating my access database to SQL Server. I have a
crosstab query in Access which is
TRANSFORM Sum(tblCurrentMonth.[Total Price]) AS
[SumOfTotal Price]
SELECT tblCurrentMonth.[Long Code], tblExpenseCodes.
[Report Client], tblCurrentMonth.[Billing Cycle Name], Sum
(tblCurrentMonth.[Total Price]) AS Total
FROM tblExpenseCodes INNER JOIN tblCurrentMonth ON
tblExpenseCodes.[long code] = tblCurrentMonth.[Long Code]
GROUP BY tblCurrentMonth.[Long Code], tblExpenseCodes.
[Report Client], tblCurrentMonth.[Billing Cycle Name]
PIVOT tblCurrentMonth.[Product Name] In ("Data
Center","Desktop","Internet Hosting","Market
Data","Messaging &
Mobile","Network","Other","Projects","Technology Requests
(MAC's)","Voice & Conferencing");
The Pivot and Transform dont seem to work. Can anyone
please suggest me how to write this query in SQL Server.
Thanks in advance for your assistance.
Regards,
Subir
- Next message: Smith: "Changing 100 table object owner names at once"
- Previous message: anonymous_at_discussions.microsoft.com: "Dynamic SQL and IN list - Thanks!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|