Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
环境:windows xp sp3
sql 2005
表名:title
列名:PublishedTime
数据类型:smalldatetime
NodeMouseDoubleClick中加入代码,代码如下:
Dim Value()As String
Dim Filter As String
Value = e.Node.FullPath.Split("\")
Select Case e.Node.Level
Case 0
Filter ="[Keyword] = '" & Value(0) & "'"
Case 1
Dim year As Integer = Value(1)
Dim StartDate As Date = New Date(year,1,1) '起始日期变量
Dim EndDate As Date = New Date(year,12,31) '结束日期变量
Filter ="[Keyword] = '" & Value(0) & "' And [PublishedTime] >= #" & StartDate & "# And [PublishedTime] <= #" & EndDate & "# "
End Select
DataTables("Title").LoadFilter = Filter
DataTables("Title").Load()
Case 0双击正常
Case 1错误
错误提示如下:
恳请老鸟指点!!
呵呵,Sql Serverd日期应该用单引号括起来,而不是#:
Filter ="[Keyword] = '" & Value(0) & "' And [PublishedTime] >= '" & StartDate & "' And [PublishedTime] <= '" & EndDate & "'"
参考一下这一章,其中条件表达式的部分有讲述:
http://help.foxtable.com/topics/0688.htm
谢谢狐狸爸爸!!!