Please help me figure out a solution to this problem.
I have a table that tracks the amount of money received from various companies. In some cases there is more than one amount received from the same company. Here is some sample data from the table:
CompanyID, Date, Amount, Code
5, 12/18/2000, $250.00, B M
5, 7/3/2001, $350.00, SP
8, , $100.00, M
9, , $150.00, M
9, , $250.00, gen
I need to create a new table so that all data associated with the same CompanyID appears in the same row. See example below:
CompanyID, Date, Amount, Code, Date2, Amount2, Code2
5, 12/18/2000, $250.00, B M, 7/3/2001, $350.00, SP
9, , $150.00, M, , $250.00, gen
I know this is inefficient in terms of database design. However the reason I need this new table is to export the data into excel for further manipulation.
Any ideas on how I can accomplish this task? Any help would be appreciated. Thanks. -Josh
I have a table that tracks the amount of money received from various companies. In some cases there is more than one amount received from the same company. Here is some sample data from the table:
CompanyID, Date, Amount, Code
5, 12/18/2000, $250.00, B M
5, 7/3/2001, $350.00, SP
8, , $100.00, M
9, , $150.00, M
9, , $250.00, gen
I need to create a new table so that all data associated with the same CompanyID appears in the same row. See example below:
CompanyID, Date, Amount, Code, Date2, Amount2, Code2
5, 12/18/2000, $250.00, B M, 7/3/2001, $350.00, SP
9, , $150.00, M, , $250.00, gen
I know this is inefficient in terms of database design. However the reason I need this new table is to export the data into excel for further manipulation.
Any ideas on how I can accomplish this task? Any help would be appreciated. Thanks. -Josh