cmd.CommandText = "select 年, 销售_母猪 + 销售_公猪 + 销售_肉猪 + 补贴项目 + 其他收入 as 合计 f rom " & _
"(Select YEAR(销售_日期) As 年, sum(销售_母猪) As 销售_母猪, sum(销售_公猪) As 销售_公猪, sum(销售_肉猪) As 销售_肉猪, sum(补贴项目) As 补贴项目, sum(其他收入) As 其他收入 f rom" & _
"(Select 销售_日期, 销售_金额 As 销售_母猪, 0 As 销售_公猪, 0 As 销售_肉猪, 0 As 补贴项目, 0 As 其他收入 f rom {母猪基本信息} where [sys_user]='" & user.Name & "' u nion all " & _
"Select 销售_日期, 0, 销售_金额 As 销售_公猪, 0, 0, 0 f rom {公猪信息} where [sys_user]='" & user.Name & "' u nion all " & _
"Select 销售_日期, 0, 0, 销售_金额 As 销售_肉猪, 0, 0 f rom {肉猪信息} where [sys_user]='" & user.Name & "' u nion all " & _
"Select 日期, 0, 0, 0, 金额 As 补贴项目, 0 f rom {补贴项目} where [sys_user]='" & user.Name & "' u nion all " & _
"Select 日期, 0, 0, 0, 0,金额 As 其他收入 f rom {其他收入} where [sys_user]='" & user.Name & "') as b) " & _
"As a group by 年 order by year 年 "