如下,
Dim cmd12 As New SQLCommand
Dim dtt12 As DataTable
cmd12.C
Dim Cols1A12() As String = {"dDate","cInvCode","iQuantity","cCusName","cPersonName","cSTName"}
Dim Cols2A12() As String = {"OrderDate","PartNo","OrderQty","EndCustomer","Sales","销售类别"}
cmd12.CommandText = "Se/lect dDate,cInvCode,iQuantity,cCusName,cPersonName,cSTName From (((({rdrecord32} Inner JOIN {rdrecords32} ON {rdrecords32}.[ID] = {rdrecord32}.[ID]) Inner JOIN {Customer} ON {Customer}.[cCusCode] = {rdrecord32}.[cCusCode]) Inner JOIN {Person} ON {Person}.[cPersonCode] = {rdrecord32}.[cPersonCode]) Inner JOIN {SaleType} ON {SaleType}.[cSTCode] = {rdrecord32}.[cSTCode]) Where dDate > '2023/06/06' "
dtt12=cmd12.ExecuteReader()
For Each dr112 As DataRow In dtt12.DataRows
Dim dr212 As DataRow = DataTables("Orderlist2").AddNew()
For i12 As Integer = 0 To Cols1A12.Length -1
dr212(Cols2A12(i12)) = dr112(Cols1A12(i12))
dr212("类别") = "销售出库"
dr212("day") = day("OrderDate")
Next
Next
此主题相关图片如下:pci.jpg
[此贴子已经被作者于2023/6/13 12:04:01编辑过]