以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 按年度查询 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=142795) |
-- 作者:zyxhx -- 发布时间:2019/11/6 15:20:00 -- 按年度查询 老师,您好!如图查询按钮,我想将“缴费日期”列,按年度查询,如下代码应该如何修改?请老师指点。 Dim nms() As String = {"xinminbox","sfzbox","ynzbox","niandu"} Dim sps() As String = {"\'","\'","\'","#"} Dim bjf() As String = {" = "," = "," = "," = "} Dim fds() As String = {"姓名","身份证号","医疗证号","缴费时间"} Dim filter As String Dim dt As DataTable For i As Integer = 0 To nms.Length - 1 If e.Form.Controls(nms(i)).value IsNot Nothing Then If filter > "" Then filter = filter & " and " End If filter = filter & fds(i) & bjf(i) & sps(i) & e.Form.Controls(nms(i)).value & sps(i) End If Next If filter > "" Then Tables("参合成员信息").filter = filter End If [此贴子已经被作者于2019/11/6 15:20:34编辑过]
|
-- 作者:有点蓝 -- 发布时间:2019/11/6 15:24:00 -- 年度需要单独处理,然后参考:http://www.foxtable.com/webhelp/topics/2720.htm |
-- 作者:zyxhx -- 发布时间:2019/11/6 15:34:00 -- 由于年度控件只能用组合框,用日期控件不能显示整年,我弄了半天没有弄清楚,请老师帮忙修改一下代码,谢谢! |
-- 作者:有点蓝 -- 发布时间:2019/11/6 15:46:00 -- im y As Integer = val(e.Form.Controls("niandu").value) Dim dt1 As New Date(y, 1, 1) Dim dt2 As New Date(y, 12, 31) Dim Filter As String Filter = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "#" Tables("订单").Filter = Filter |
-- 作者:zyxhx -- 发布时间:2019/11/6 15:59:00 -- 非常感谢老师,您解决了我弄了半天没有弄明白的问题。每次打扰您都很不好意思,只是我实在是学会的太少了。 |