要是这样,直接透视就可以了。如果楼主经常要用到这张表,建议修改表的格式。也就是你要求得到的那样,平时输入数据。期末用透视表汇总就可以了。
楼主的表很不规范。表头中的字段有很多空格。看起来都累。为了便于透视,我将表头字段中间的空白去掉。导入外部查询,语句如下:
select 型号,[宽度/色号],"010" as 尺码,010 as 值 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"020",020 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"025",025 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"030",030 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"035",035 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"040",040 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"045",045 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"050",050 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"055",055 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"060",060 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"065",065 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"070",070 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"075",075 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"080",080 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"085",085 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"090",090 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"095",095 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"100",100 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"105",105 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"110",110 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"120",120 from [订单$A1:Y5] union all
select 型号,[宽度/色号],"130",130 from [订单$A1:Y5]
[ 本帖最后由 抹香鲸2009 于 2010-5-7 11:16 编辑 ] |