Hi,
I have one table that contain information on clients for different years. The format of the table looks like this:
An ODBC connection is created, and information is taken from the MYSQL database as a recordset, and pasted in Excel. I need to present the data in the following format to make it more readable. The required format:
I assume the SQL would entail some type of JOIN or UNION command referencing the same table a few times in order to get each column separate (and only showing the ClientCode once), but I could not get it working myself. I've searched high and low for example code from other programmers, but could not find any.
Any help would be appreciated!
I have one table that contain information on clients for different years. The format of the table looks like this:
ClientCode | Year | Status |
C001 | 2019 | Done |
C001 | 2020 | Done |
C001 | 2021 | Todo |
K001 | 2020 | Done |
K001 | 2021 | Todo |
T002 | 2021 | Done |
W001 | 2021 | Todo |
An ODBC connection is created, and information is taken from the MYSQL database as a recordset, and pasted in Excel. I need to present the data in the following format to make it more readable. The required format:
ClientCode | 2019 | 2020 | 2021 |
C001 | Done | Done | Todo |
K001 | Done | Todo | |
T002 | Done | ||
W001 | Todo |
I assume the SQL would entail some type of JOIN or UNION command referencing the same table a few times in order to get each column separate (and only showing the ClientCode once), but I could not get it working myself. I've searched high and low for example code from other programmers, but could not find any.
Any help would be appreciated!