AndyC88
Member
- Local time
- Today, 12:52
- Joined
- Dec 4, 2020
- Messages
- 44
Hi all,
I have a Crosstab Query with a large number of columns (~100) which require to be in a custom order.
I have achieved this by sorting and concatenating the column headers into a string within an unbound text box ("Equipment53","Equipment54","Equipment55","Equipment56" etc...) and pasting that into the column headings box in the properties tab in the Design View.
The problem is the column headings are likely to change in the future. I have tried defining the unbound text box as a parameter within the crosstab Query in the PIVOT IN clause but it returns an error (SYNTAX error in transform statement).
Is there any way to achieve this in SQL? Or is there a way to use VBA to update the Column Headings in the Crosstab Query?
Grateful for any assistance!
Thanks,
Andy
I have a Crosstab Query with a large number of columns (~100) which require to be in a custom order.
I have achieved this by sorting and concatenating the column headers into a string within an unbound text box ("Equipment53","Equipment54","Equipment55","Equipment56" etc...) and pasting that into the column headings box in the properties tab in the Design View.
The problem is the column headings are likely to change in the future. I have tried defining the unbound text box as a parameter within the crosstab Query in the PIVOT IN clause but it returns an error (SYNTAX error in transform statement).
Is there any way to achieve this in SQL? Or is there a way to use VBA to update the Column Headings in the Crosstab Query?
Grateful for any assistance!
Thanks,
Andy