以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- [求助]关于日期查询的问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=61310)
|
-- 作者:lrh9537
-- 发布时间:2014/12/10 17:31:00
-- [求助]关于日期查询的问题
比如:我设置了单位,一个开始日期,一个结束日期,然后对某个单位进行查询,该怎么整?用日期控件
|
-- 作者:有点甜
-- 发布时间:2014/12/10 18:20:00
--
http://www.foxtable.com/help/topics/1058.htm
|
-- 作者:lrh9537
-- 发布时间:2014/12/10 18:28:00
--
Dim Filter As String With e.Form.Controls("cmbProduct") If .Value IsNot Nothing Then Filter = "单位 = \'" & .Value & "\'" End If End With With e.Form.Controls("StartDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "日期 >= #" & .Value & "#" End If End With With e.Form.Controls("EndDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "日期 <= #" & .Value & "#" End If
这样改对吗
|
-- 作者:wyz20130512
-- 发布时间:2014/12/10 18:45:00
-- 回复
有时间加我的QQ468163809,再详谈。
加时请注明:(lrh9537)[求助]关于日期查询的问题
|
-- 作者:有点甜
-- 发布时间:2014/12/10 19:11:00
--
Dim Filter As String With e.Form.Controls("cmbProduct") If .Value IsNot Nothing Then Filter = "单位 = \'" & .Value & "\'" End If End With With e.Form.Controls("StartDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "日期 >= #" & .Value & "#" End If End With With e.Form.Controls("EndDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "日期 <= #" & .Value & "#" End If End With
Tables("表A").filter = Filter
|
-- 作者:lrh9537
-- 发布时间:2014/12/11 7:23:00
--
4、插入一个日期输入框,改为名“StartDate”,用于输入开始日期。 5、插入一个日期输入框,改为名“EndDate”,用于输入结束日期。 这两个控件怎么定义,怎么运用
Dim sd As WinForm.DateTimePicker Dim ed As WinForm.DateTimePicker sd = e.Form.Controls("StartDate") ed = e.Form.Controls("EndDate") 对吗
[此贴子已经被作者于2014-12-11 7:39:33编辑过]
|
-- 作者:lrh9537
-- 发布时间:2014/12/11 7:49:00
--
If CurrentTable.DataTable.Name = "出生" Then \'如果选择的主表 CurrentTable.Cols("单位名称").Combolist = DataTables("出生").GetComboListString("单位名称") Dim dw As WinForm.ComboBox = e.Form.Controls("单位名称") Tables("出生").Filter= "单位名称 = \'"& dw.text & "\'" End If Dim sd As WinForm.DateTimePicker Dim ed As WinForm.DateTimePicker sd = e.Form.Controls("StartDate") ed = e.Form.Controls("EndDate")
Dim Filter As String With e.Form.Controls("StartDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "子女出生日期 >= #" & .Value & "#" End If End With With e.Form.Controls("EndDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "子女出生日期 <= #" & .Value & "#" End If End With
Tables("出生").filter = Filter
这个怎么按村查询不了,帮忙改下
|
-- 作者:有点甜
-- 发布时间:2014/12/11 9:09:00
--
看5楼,就那样改。
|