以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 获取最大值 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=112715) |
-- 作者:zhangxl1964 -- 发布时间:2018/1/1 18:33:00 -- 获取最大值 有点甜老师:你好! 我想获取查询表中的最大值并填入当前表中, 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 |
-- 作者:有点甜 -- 发布时间:2018/1/1 18:54:00 -- 你这种,直接用分组统计就可以了啊
http://www.foxtable.com/webhelp/scr/0158.htm
http://www.foxtable.com/webhelp/scr/1626.htm
|