I need to create a crosstab query with multiple columns. I have attached the sample table and the format that I'm looking for. Thanks Database1.accdb Sample.PNG
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
what you want to do cannot be done with a cross-tab query alone. What I would do is loop through the records using VBA for each location and write the results to Excel or Word -- and I would recommend Excel since formulas are easier -- and it can also pivot information.
I would generally agree with Crystal, although you can create a crosstab query which would return headings like:
Nationwide|FY16   Nationwide|FY17     Nationwide|Variance   Irvine|FY16     Irvine|FY17    Irvine|Variance
The way to do this is to concatenate two field ([Location] &Â "|" &Â "[Year]) in the query column you designate as "Column Header".
However, this would probably involve generating the crosstab query against a union query, which is what you would need to compute the data for your [Variance] columns and to compute your Total Dispositions row at the bottom.
I don't have access to the database now (on my iPad), but will take a look at your later this evening.
Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Microsoft Access
--
Questions
--
Followers
Top Experts
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.