Pivot Table SQL error

H

hlam

The following SQL I copied and pasted from a query doesn't work. Can anyone
take a minute and look what I have done wrong?

Thanks!

str = "TRANSFORM Sum([tbl_Work_Table_Select_Rec].[Volume]) AS VolumeOfSum "
str = str & "SELECT [tbl_Work_Table_Select_Rec].[Op_ID],
[tbl_Work_Table_Select_Rec].[Job_Code], "
str = str & "Sum([tbl_Work_Table_Select_Rec].[Volume]) AS TotalOfVolume "
str = str & "FROM tbl_Work_Table_Select_Rec "
str = str & "GROUP BY [tbl_Work_Table_Select_Rec].[Op_ID], "
str = str & "[tbl_Work_Table_Select_Rec].[Job_Code] "
str = str & "PIVOT [tbl_Work_Table_Select_Rec].[Day];"
DoCmd.RunSQL str
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top