Dim cmd As New SQLCommand
Dim dt as datatable
Dim dtt as datatable
cmd.Connecti
cmd.CommandText= "SELECT distinct 日报员工 from V_APP_本月日报明细"
dt = cmd.ExecuteReader()
If dt.DataRows.Count > 0 then
Dim rbyg As List(Of String)
rbyg = dt.GetValues("日报员工")
For Each xm As String In rbyg
'messagebox.show(xm)
cmd = New SQLCommand
cmd.ConnectionName = "数据源"
cmd.CommandText= "SELECT 日报日期,日报员工,工序_名称 as 工序,订单编号,sum(金额) as 金额 from V_APP_本月日报明细 WHERE 日报员工 = '" & xm & "' group by 日报日期,日报员工,工序_名称,订单编号 ORDER BY 日报日期,工序_名称,订单编号"
dtt = cmd.ExecuteReader()