以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 筛选周行 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=133819) |
||||
-- 作者:yangwenghd -- 发布时间:2019/4/21 12:34:00 -- 筛选周行 ![]() ![]() 老师,能帮忙看看这个吗? 如果年份和周是分开的,然后要筛选出他们的行应该怎么筛选啊? 点击按钮,怎么筛选出文字控件对应的行啊,感谢 感谢
|
||||
-- 作者:有点色 -- 发布时间:2019/4/21 17:32:00 -- Dim str As String = "第2019-14周" str = str.SubString(1, str.length-2) Dim ary = str.split("-") Tables("表a").filter = "年份=\'" & ary(0) & "\' and 本周周数=\'" & ary(1) & "\'" |
||||
-- 作者:yangwenghd -- 发布时间:2019/4/21 20:22:00 -- 谢谢老师 感谢 |
||||
-- 作者:yangwenghd -- 发布时间:2019/4/22 21:21:00 -- 老师 能再请教你个问题吗? 如果 Label11 显示的“本周计划”和“上一周” 的时候 那个时间可以为电脑显示的年份和周来筛选吗? 比如 如果Label11 显示的本周计划,然后以电脑时间筛选出本周的行。 如果是上一周就以电脑时间筛选出上一周的 的行, 如果Label11 既不是 本周计划也不是上一周,就执行红色代码,给您们添麻烦了,感谢 感谢 \'Dim str As String = "第2019-14周" Dim str As String = e.form.controls("Label11").text str = str.SubString(1, str.length-2) Dim ary = str.split("-") Tables("当周工作显示窗口_Table1").filter = "年份=\'" & ary(0) & "\' and sys_weekofyear=\'" & ary(1) & "\'" |
||||
-- 作者:有点蓝 -- 发布时间:2019/4/22 21:29:00 -- “本周计划” Dim calCommon As New System.Globalization.GregorianCalendar() Dim dt As Date = Date.Today dim w = calCommon.GetWeekOfYear(dt, System.Globalization.CalendarWeekRule.FirstDay, 0) Tables("当周工作显示窗口_Table1").filter = "年份=\'" & Date.Today.year & "\' and sys_weekofyear=\'" & w & "\'"
|
||||
-- 作者:yangwenghd -- 发布时间:2019/9/3 16:15:00 -- 老师,能帮忙看看 被筛选的字段不懂吗? If e.Form.Controls("Label11").Text = "Work this week" Then Dim calCommon As New System.Globalization.GregorianCalendar() Dim dt As Date = Date.Today Dim w = calCommon.GetWeekOfYear(dt, System.Globalization.CalendarWeekRule.FirstDay, 0) Tables("当周工作显示窗口_Table1").filter = "年份=\'" & Date.Today.year & "\' and sys_weekofyear=\'" & w & "\'" Else If e.Form.Controls("Label11").Text = "Last week" Then Dim calCommon As New System.Globalization.GregorianCalendar() Dim dt As Date = Date.Today Dim w = calCommon.GetWeekOfYear(dt, System.Globalization.CalendarWeekRule.FirstDay, 0) Tables("当周工作显示窗口_Table1").filter = "年份=\'" & Date.Today.year & "\' and sys_weekofyear=\'" & w & "\'" Else Dim str As String = e.form.controls("Label11").text str = str.SubString(3, str.length-0) Dim ary = str.split("-") Tables("当周工作显示窗口_Table1").filter = "年份=\'" & ary(0) & "\' and sys_weekofyear=\'" & ary(1) & "\'" End If End If |
||||
-- 作者:狐狸爸爸 -- 发布时间:2019/9/3 16:18:00 -- 这样你就明白了: Dim str As String = e.form.controls("Label11").text MessageBox.Show(str)
str = str.SubString(3, str.length-0) MessageBox.Show(str) Dim ary = str.split("-") MessageBox.Show(ary(0) & "----" & ary(1)) Tables("当周工作显示窗口_Table1").filter = "年份=\'" & ary(0) & "\' and sys_weekofyear=\'" & ary(1) & "\'" |
||||
-- 作者:yangwenghd -- 发布时间:2019/9/3 16:35:00 -- 谢谢老师,好方法,问题解决了,知识也学习了,感谢 |