How to Split Access Query Data into Multiple Columns
Question details
The user wants to display multiple related records (such as various fruits assigned to a single person) horizontally across separate columns instead of vertically in multiple rows.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Designing a query or report layout where hierarchical or related one-to-many data needs to be pivoted for horizontal viewing.
- Observed behavior
- Currently, the database output displays duplicate person records on separate rows for each associated item. The goal state is to consolidate the person into one row and spread their respective items across multiple columns dynamically.
Ensure your underlying data tables remain properly normalized (First Normal Form) before applying these techniques. Permanently altering your base table structure to add multiple item columns will complicate future data management.
Use a Crosstab Query with Dynamic Column Headings
The most efficient way to pivot row data into columns dynamically without permanently denormalizing your database structure.
A crosstab query calculates totals, averages, or counts and groups the results by two sets of values: one down the left side and one across the top. This effectively pivots your vertical data into a horizontal layout.
Navigate to the Create tab on the Access ribbon and click Query Design to initiate a new query.
On the Query Design ribbon, locate the Query Type group and click the Crosstab button.
Add the field you want to group your records by (e.g., PersonName). In the query grid, set the Crosstab row for this field to 'Row Heading'.
Add the field containing the distinct items you want to split into columns (e.g., FruitType). Set the Crosstab row for this field to 'Column Heading'.
Add the field you want to display or calculate inside the grid. Set the Total row to 'First' (to display text) or 'Count' (for numbers), and set the Crosstab row to 'Value'.
Create a Multi-Column Subreport
Use this method if you are designing a printed or PDF report and need to arrange related data items horizontally across the page.
Need a simpler way to analyze data? Try WPS Spreadsheet
While Microsoft Access is powerful for complex relational databases, many data splitting, pivoting, and formatting tasks are much easier to handle in a spreadsheet environment. WPS Office provides a lightweight, free alternative to Microsoft Office, featuring robust PivotTable capabilities to effortlessly turn rows into columns without writing complex queries.
- 1. Export Your Data: Export your raw Access data as an Excel (.xlsx) or CSV file.
- 2. Open in WPS Spreadsheet: Launch WPS Office and open the exported data file.
- 3. Insert a PivotTable: Highlight your dataset, click the 'Insert' tab, and select 'PivotTable'. Drag your category fields into the Columns area to instantly split the data horizontally.

Frequently Asked Questions
Why shouldn't I just create a new table with multiple columns for each item?
Creating a denormalized table with multiple identical columns (e.g., Item1, Item2, Item3) violates the First Normal Form of database design. It makes querying, updating, and expanding your data much more difficult, as adding a new item would require fundamentally changing the table structure.
Can I use Access macros to split query data into separate columns?
While macros in Access are useful for simple automation tasks, complex data reshaping tasks are generally better handled using Visual Basic for Applications (VBA) due to its superior capabilities with recordset looping and dynamic data manipulation.
What should I do if my crosstab query is running too slowly?
If a crosstab query is slow, first ensure that the fields used for grouping and column headings are properly indexed in your underlying tables. Only in cases of extreme performance bottlenecks should you consider using VBA to temporarily write the processed results into an interim denormalized table specifically for reporting purposes.




