Reputation: 587
I have a line of code that creates a CrossTab query in MS Access that is producing an error.
Here is the code:
Dim cmd4 As OleDbCommand = New OleDbCommand("TRANSFORM First(y.Daily_Growth) AS FirstOfDaily_Growth Select y.Ticker FROM Daily_Growth_Rates AS y GROUP BY y.Ticker ORDER BY y.[Date] DESC PIVOT y.[Date]", Nordeen_Investing_3.con)
Here is the error:
Additional information: Too many crosstab column headers (7326).
What am I doing wrong?
Upvotes: 1
Views: 1255
Reputation: 97100
You're trying to PIVOT
on dates. If the date range is something like a full year, then you would exceed the 255 maximum columns for a table or query.
If you want to PIVOT
on dates, you must select a narrower date range. See whether the query can work with data from a single month.
Upvotes: 4