Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone help me convert this

Status
Not open for further replies.

zishan619

Programmer
May 28, 2003
284
MX
Hi I need help writing this on T-SQL:
TRANSFORM Sum(Data.dblHours) AS [The Value]
SELECT A.LastName + ' , ' + A.FirstName AS Analyst, A.UID, M.LastName + ' , ' + M.FirstName AS Manager, A.CCNum, Data.dtsDate
FROM ((TAS_PeopleDynamic AS A INNER JOIN TAS_PeopleDynamic AS M ON A.MgrUID = M.UID) INNER JOIN TAS_TimeProdData AS Data ON A.UID = Data.UID) INNER JOIN TAS_validTimeProdCodes AS Code ON Data.TPCodeID = Code.TPCodeID
WHERE A.CCNum='1867' AND Data.dtsDate Between '1/1/04' And '1/1/04'
GROUP BY A.LastName + ' , ' + A.FirstName, A.UID, M.LastName + ' , ' + M.FirstName, A.CCNum, Data.dtsDate
PIVOT Code.TPCode
I have no idea how to do this cross tab query. Thanks
 
Unfortunately SQL Server doesn't support the crosstab function that's available in Access, so you can't convert it.

I use an Access front ent to SQL server and the only way I can do a crosstab query is by summarising the data as much as possible in the server database, dragging it to an Access table and then running the crosstab in Access.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top