S
subir.kumar
Hi,
I am migrating my access database to SQL Server. I have a
crosstab query in Access which is
TRANSFORM Sum(qryDatafile2003.[Total Price]) AS
[SumOfTotal Price]
SELECT qryDatafile2003.[Product Code], qryDatafile2003.
[Sub Product Code], tblExpenseCodes.[Report Client], First
(qryDatafile2003.[Product Name]) AS [FirstOfProduct Name],
First(qryDatafile2003.[Sub Product Name]) AS [FirstOfSub
Product Name]
FROM qryDatafile2003 INNER JOIN tblExpenseCodes ON
qryDatafile2003.[Long Code] = tblExpenseCodes.[long code]
GROUP BY qryDatafile2003.[Product Code], qryDatafile2003.
[Sub Product Code], tblExpenseCodes.[Report Client]
PIVOT Format([Billing Cycle Name],"mmm") & "-" & Format
([Billing Cycle Name],"yy") In ("Apr-03","May-03","Jun-
03","Jul-03","Aug-03","Sep-03","Oct-03","Nov-03","Dec-
03","Jan-04","Feb-04","Mar-04");
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
I am migrating my access database to SQL Server. I have a
crosstab query in Access which is
TRANSFORM Sum(qryDatafile2003.[Total Price]) AS
[SumOfTotal Price]
SELECT qryDatafile2003.[Product Code], qryDatafile2003.
[Sub Product Code], tblExpenseCodes.[Report Client], First
(qryDatafile2003.[Product Name]) AS [FirstOfProduct Name],
First(qryDatafile2003.[Sub Product Name]) AS [FirstOfSub
Product Name]
FROM qryDatafile2003 INNER JOIN tblExpenseCodes ON
qryDatafile2003.[Long Code] = tblExpenseCodes.[long code]
GROUP BY qryDatafile2003.[Product Code], qryDatafile2003.
[Sub Product Code], tblExpenseCodes.[Report Client]
PIVOT Format([Billing Cycle Name],"mmm") & "-" & Format
([Billing Cycle Name],"yy") In ("Apr-03","May-03","Jun-
03","Jul-03","Aug-03","Sep-03","Oct-03","Nov-03","Dec-
03","Jan-04","Feb-04","Mar-04");
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