我觉得应该要订单表中增加一个月的表达式列,表达式代码帮助中有,如: SUBSTRING(Convert([日期],'System.String'),6,IIF(SUBSTRING(Convert([日期],'System.String'),7,1) = '-',1,2))
然后将楼上的代码改成:
Dim de As Date = Tables("调用").Current("日期") Dim Month As Integer = de.Month Dim Min As Integer = DataTables("订单").Compute("Min(编号)","月 = '" & Month & "'") DataTables("调用").DataRows.Clear() If MainTable.Name = "调用" Dim f As New Filler f.SourceTable = DataTables("订单") f.SourceCols = "产品,单价,折扣,数量,日期,已付款,编号,型号" f.DataTable = DataTables("调用") f.DataCols = "产品,单价,折扣,数量,日期,已付款,编号,型号" f.Filter = "[编号] = '" & Min & "' And [月] = '" & Month & "'" f.Fill() End If
|