Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Converting an Access pivot query to SQL 2005

Author  Topic 

CSharpNewbie
Starting Member

39 Posts

Posted - 2010-09-28 : 07:17:16
Hi, I am new to table pivot and would like to know how to go about converting the following query in Access to SQL Server 2005:

TRANSFORM First(tbl_Proj_Budget.BUGDET_LINE_BURDENED_COST) AS FirstOfBUGDET_LINE_BURDENED_COST 
SELECT tbl_Proj_Budget.PROJ_ID, First(tbl_Proj_Budget.BUGDET_LINE_BURDENED_COST) AS [Total Of BUGDET_LINE_BURDENED_COST]
FROM tbl_Proj_Budget
GROUP BY tbl_Proj_Budget.PROJ_ID
PIVOT tbl_Proj_Budget.RESOURCE_LIST_ALIAS;


For instance, what does the 1st line mean?
TRANSFORM First(tbl_Proj_Budget.BUGDET_LINE_BURDENED_COST) AS FirstOfBUGDET_LINE_BURDENED_COST


Thanks

Sachin.Nand

2937 Posts

Posted - 2010-09-28 : 07:20:34
Have a look here

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=149905

PBUH

Go to Top of Page

CSharpNewbie
Starting Member

39 Posts

Posted - 2010-09-28 : 08:08:32
Thanks Sachin for your reply.

I have a follow up question. When I clicked the link, your response had a "u" and a "v" in your query. What does the "u" and "v" imply?

GROUP BY qry_DateTemp.Date
)u



for qry_DateTemp.RoomNumber In (201,202,203,204,205,206,207,208,209,210))v
Go to Top of Page
   

- Advertisement -