Foxtable(狐表)用户栏目专家坐堂 → textbox问题


  共有2357人关注过本帖树形打印复制链接

主题:textbox问题

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/3 9:17:00 [显示全部帖子]

Dim nd As String = "2018"
Dim yf As String = "七月"
Dim kh As String = "abc"
Dim filter As String = "1=1"
If nd > "" AndAlso yf > "" Then
    Dim ary() = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"}
    Dim d As Date = new Date(nd, ary.Indexof(ary, yf.trim("月"))+1, 1)
    filter &= " and 日期 >= #" & d & "# and 日期 < #" & d.addmonths(1) & "#"
End If
If kh > "" Then
    filter &= " and 客户 = '" & kh & "'"
End If
msgbox(filter)
'然后写compute查询各个表数据
'Dim sum As Double = DataTables("表A").compute("sum(金额)", filter)

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/3 16:03:00 [显示全部帖子]

红色改成你订单主表的日期列的列名

 

filter &= " and 日期 >= #" & d & "# and 日期 < #" & d.addmonths(1) & "#"


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/4 9:17:00 [显示全部帖子]

Dim nd As String = "2018"
Dim yf As String = "七月"
Dim kh As String = "abc"
Dim filter As String = "1=1"
If nd > "" AndAlso yf > "" Then
    Dim ary() = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"}
    Dim d As Date = new Date(nd, ary.Indexof(ary, yf.trim("月"))+1, 1)
    filter &= " and 订单日期 >= #" & d & "# and 订单日期 < #" & d.addmonths(1) & "#"
End If
If kh > "" Then
    filter &= " and 客户名称 = '" & kh & "'"
End If
msgbox(filter)
Dim sum As Double = DataTables("订单主表").compute("sum(总金额)", filter)
msgbox(sum)

 回到顶部