|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
SQL查询数据已经弄出来了,还没研究出分类汇总项怎么自动填背景色,所以没发答案,就公布答案了.
SELECT "车型" ,left("发动机号码-维修代码",11) As "发动机号码",right("发动机号码-维修代码",6) As "维修代码","1季度销量","2季度销量","3季度销量","4季度销量",2007 As "年份", '旗舰1店' As "4S店名" FROM [D:\竞赛基础题\2007年`.`旗舰1店$] UNION ALL
SELECT "车型" ,left("发动机号码-维修代码",11) As "发动机号码",right("发动机号码-维修代码",6) As "维修代码",0 As "1季度销量",0 As "2季度销量",0 As "3季度销量","4季度销量",2007 As "年份", '旗舰2店' As "4S店名" FROM [D:\竞赛基础题\2007年`.`旗舰2店$] UNION ALL
SELECT "车型" ,left("发动机号码-维修代码",11) As "发动机号码",right("发动机号码-维修代码",6) As "维修代码","1季度销量","2季度销量","3季度销量",0 as "4季度销量",2008 As "年份", '旗舰3店' As "4S店名" FROM [D:\竞赛基础题\2008年`.`旗舰3店$] UNION ALL
SELECT "车型" ,left("发动机号码-维修代码",11) As "发动机号码",right("发动机号码-维修代码",6) As "维修代码",0 As "1季度销量","2季度销量",0 As "3季度销量","4季度销量",2008 As "年份", '旗舰4店' As "4S店名" FROM [D:\竞赛基础题\2008年`.`旗舰4店$]
[ 本帖最后由 qygszlb 于 2009-3-23 23:54 编辑 ] |
|