有点甜老师:你好! 我想获取查询表中的最大值并填入当前表中,
Dim QueryMonth As Date '自定义日期
QueryMonth=Forms("申购单").Controls("DateTimePicker1").value Dim jb2 As New SQLJoinTableBuilder("查询表1","入库明细")
jb2.C
Dim dt As DataTable
jb2.AddCols("日期","存货编码","入库单价")
jb2.Filter = "日期 <= '" & QueryMonth & " '"
dt = jb2.Build(True) '生成一个DataTable
For Each dr As DataRow In DataTables("申购明细").DataRows
Dim fdr As DataRow = dt.find("[存货编码] = '" & dr("存货编码") & "' and [日期] <= '" & QueryMonth & "'", "日期 desc") '这里的日期应该怎样撰写代码?
dr("进货单价") = fdr("入库单价")
Next