Foxtable(狐表)用户栏目专家坐堂 → 按周查询的问题?


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

主题:按周查询的问题?

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


加好友 发短信
等级:超级版主 帖子:111427 积分:567211 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/2/25 14:47:00 [显示全部帖子]

'查看量房开始
Dim cbx1 As WinForm.ComboBox = e.Form.Controls("ComboBox5")
Dim cbx2 As WinForm.ComboBox = e.Form.Controls("ComboBox6")
Dim filter As String = "1=1"
If cbx1.text > "" Then
    Dim year As String = cbx1.text.SubString(0,2)
    Dim week As String = cbx1.text.SubString(3,2)
    Dim d As Date = new Date(year+2000, 1, 1)
    Dim w = d.DayOfWeek
    Dim startdate As Date
    Dim Enddate As Date
    Select Case week
        Case "01"
            startdate = d
            Enddate = d.AddDays(7-w)
        Case "53"
            startdate = d.AddDays(7-w).AddDays(7*51)
            Enddate = d.AddYears(1)
        Case Else
            startdate = d.AddDays(7-w).AddDays(7*(val(week)-2))
            Enddate = startdate.AddDays(7)
    End Select
    msgbox(startdate & "-" & Enddate )
    filter &= " and 量房时间 >= #" & startdate  & "# and 量房时间 < #" & Enddate  & "#"
End If
If cbx2.text > "" Then
    filter &= " and 设计师 = '" & cbx2.text & "'"
End If
'msgbox(filter)
e.Form.controls("table1").Table.Filter = filter
'查看量房结束

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


加好友 发短信
等级:超级版主 帖子:111427 积分:567211 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/2/25 17:16:00 [显示全部帖子]

d.AddDays(7-w)

 

改为

 

d.AddDays(8-w)


 回到顶部