以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  日期代码错误,求帮助  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=27911)

--  作者:雁过不留痕8
--  发布时间:2013/1/14 9:55:00
--  日期代码错误,求帮助
Dim a1 As WinForm.TextBox = e.Form.Controls("TextBox1")

Dim a2 As WinForm.TextBox = e.Form.Controls("TextBox2")

Dim a3 As WinForm.TextBox = e.Form.Controls("TextBox3") 

Tables("统计查询_table1").filter="[增加完成数量的时间]>=#a2.text/a3.text/a1.text 8:39:00# And [增加完成数量的时间]<=#1/14/2013 8:40:13#"
Forms("统计查询输入查询日期").close

运行出错,提示The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.
怎样利用 a1.text a2.text a3.text 生成1/14/2013

--  作者:lin_hailun
--  发布时间:2013/1/14 10:17:00
--  
 个人感觉这样比较好

Dim a1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim a2 As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim a3 As WinForm.TextBox = e.Form.Controls("TextBox3")

Dim d1 As Date = New Date(a1.Text, a2.Text, a3.Text, 8, 39, 0)
Dim d2 As Date = New Date(Date.Today.Year, Date.Today.Month, Date.Today.Day, 8, 40, 13)

Tables("统计查询_table1").filter="[增加完成数量的时间]>=#" & d & "# And [增加完成数量的时间]<=#" & d2 & "#"
Forms("统计查询输入查询日期").close


--  作者:雁过不留痕8
--  发布时间:2013/1/14 10:20:00
--  
谢谢林老师!!!