Can this be done by SQL query in MS Access or do I need VBA to do this?
From Table 1 to Table 2, the 'Name' column will contain over 20k names and the 'Product' column is fixed at 18 products.
(I used the | pipe as a seperator in the below tables, but this is only to illustrate how the table would look like.)
Table 1: Before
Name | Product
----------------------
Rob | AAA
Rob | BBB
Jane | BBB
Rob | CCC
Fred | EEE
Jack | AAA
Rob | DDD
MIKE | CCC
MIKE | DDD
......
Table 2: After
Name | AAA | BBB | CCC | DDD | EEE | ...TTT
-----------------------------------------------
Rob | AAA | BBB | CCC | DDD |
Jane | | BBB | | |
Fred | | | | | EEE
Jack | AAA | | | |
Mike | | | CCC | DDD |
.......
Any help is appreciated.
From Table 1 to Table 2, the 'Name' column will contain over 20k names and the 'Product' column is fixed at 18 products.
(I used the | pipe as a seperator in the below tables, but this is only to illustrate how the table would look like.)
Table 1: Before
Name | Product
----------------------
Rob | AAA
Rob | BBB
Jane | BBB
Rob | CCC
Fred | EEE
Jack | AAA
Rob | DDD
MIKE | CCC
MIKE | DDD
......
Table 2: After
Name | AAA | BBB | CCC | DDD | EEE | ...TTT
-----------------------------------------------
Rob | AAA | BBB | CCC | DDD |
Jane | | BBB | | |
Fred | | | | | EEE
Jack | AAA | | | |
Mike | | | CCC | DDD |
.......
Any help is appreciated.
Last edited: