SQL question will be used later in Excel

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,664
Hello Everyone,

I have a cross table query in Access that I need to run in SQL Server. Here is the code:

Code:
TRANSFORM Sum([track apps].Apps) AS SumOfApps
SELECT [track apps].Branch
FROM [track apps]
GROUP BY [track apps].Branch
PIVOT [track apps].MONTH;

I am running SQL Server 2005.

I get the error message:

Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'trackapps'.
Msg 170, Level 15, State 1, Line 5
Line 5: Incorrect syntax near 'PIVOT'.

I would appreciate any help on this.

TIA

Kurt
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Additional info

Hello again,

I am also trying to get this to work in Excel vba.

I forgot to add that.

Thanks,

Kurt
 
Upvote 0
Pivot table

Hello,

Yes I am looking at that possibility also.


Kurt
 
Upvote 0
I'm unsure as to what the error is but in the past I've cut and pasted SQL statements from Access to Excel via MS Query. Just another option I thought I would throw out there.
 
Upvote 0
MS Query

Hello Kyle,

Thanks for your suggestion.

I am also looking at MS Query you can get a SQL View there as well.

Kurt
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top