访问-将某些列数据转置为行记录

问题描述:

我想应用类似的功能: 复制其他数据时,将具有ID字段的某些列排成行

I would like to apply a similar function like this: "Transposing" some columns with ID fields into rows while copying the other data

但在以下情况下:

表格:

A | B | 1 | 3 | 5 | 2|

C | D | 8 | 5 | 4 | 7|

插入到这样的表中:

A | B | 1 |

A | B | 3 |

A | B | 5 |

A | B | 2 |

C | D | 8 |

C | D | 5 |

C | D | 4 |

C | D | 7 |

是否可以通过修改引用的函数来实现?还是Access中的解决方案更容易?

Is this possible by modifying the quoted function? Or a solution in Access is easier?

或者,考虑可以同时使用Jet/ACE引擎(Windows .dll文件)在Excel或Access中运行的SQL联合查询:>

Alternatively, consider an SQL union query which can be run in either Excel or Access, both using the Jet/ACE engine (Windows .dll files):

SELECT Col1, Col2, Col3
FROM TableOrSheet$Name
UNION ALL
SELECT Col1, Col2, Col4
FROM TableOrSheet$Name
UNION ALL
SELECT Col1, Col2, Col5
FROM TableOrSheet$Name
UNION ALL
SELECT Col1, Col2, Col6
FROM TableOrSheet$Name