续---数据库内数据统计问题
目前我已经用如下语句分别得到不同表单,请问如何能合并成一个总的表?1、工作日加班
程序代码:
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\考勤.mdb;Persist Security Info=False" Adodc2.RecordSource = "SELECT 序号,姓名,SUM(加班小计) as 工作日加班 FROM 考勤 WHERE (right(星期,1)<>'六' and right(星期,1)<>'日') GROUP BY 序号,姓名" Adodc2.Refresh Set DataGrid2.DataSource = Adodc2
2、双休日加班
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\考勤.mdb;Persist Security Info=False" Adodc2.RecordSource = "SELECT 序号,姓名,SUM(加班小计) as 双休加班 FROM 考勤 WHERE right(星期,1)='六' or right(星期,1)='日' GROUP BY 序号,姓名" Adodc2.Refresh Set DataGrid2.DataSource = Adodc2
3、统计表
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\考勤.mdb;Persist Security Info=False" Adodc2.RecordSource = "SELECT 序号,姓名,SUM(加班小计) as 加班小计,SUM(休假) as 休假,SUM(早班时间) as 早班时间,SUM(中班时间) as 中班时间,SUM(夜班时间) as 夜班时间 FROM 考勤 GROUP BY 序号,姓名" Adodc2.Refresh Set DataGrid2.DataSource = Adodc2
现在,想把这几张表合成一张表,如下图所示(不好意思,是画图拼接出来的):
请问,用什么语句,怎样写法,才能合并出上面这张表呢?
或者说,如何将以上的语句合并写,直接生成上面这张表呢?
恳求版主和路过的坛友在百忙中抽出点时间帮帮我,谢谢!
[此贴子已经被作者于2019-2-12 10:31编辑过]