以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [原创]帮助文件抓bug  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=17503)

--  作者:cuiler
--  发布时间:2012/3/15 14:41:00
--  [原创]帮助文件抓bug

帮助文件抓bug。

 

帮助文件

http://www.foxtable.com/help/topics/2476.htm

 

有这么一段 代码

=============================================

 

假定有个员工表,有姓名和出生日期列,希望能够筛选出今天生日的行,代码为:

Dim nms As String
For Each
dr As DataRow In DataTables("员工").DataRows
    Dim
dt As Date = dr("出生日期")
    If
dt.Month = Date.Today.Month AndAlso Date.Today.Day Then
        nms = nms & ",\'" & dr("姓名") & "\'"

    End If
Next
If
nms > "" Then
    nms = nms.Trim(","
)
    Tables(
"员工").filter = "[姓名] In (" & nms &")
"
End If

=============================================

 

 

谁能告诉我,标有背景的代码是正确,还是错误?谢谢!

 

[此贴子已经被作者于2012-3-15 15:42:03编辑过]

--  作者:view360
--  发布时间:2012/3/15 15:08:00
--  
如果日期为本月本日,就返回结果,并加上姓名

好像真的有问题。更正。呵呵。。

[此贴子已经被作者于2012-3-15 15:34:22编辑过]

--  作者:cuiler
--  发布时间:2012/3/15 15:43:00
--  
以下是引用view360在2012-3-15 15:08:00的发言:
如果日期为本月本日,就返回结果,并加上姓名

好像真的有问题。更正。呵呵。。
 

[此贴子已经被作者于2012-3-15 15:34:22编辑过]

 

 

大树兄,虽然你的酱油 很浓 ,但还是谢谢你的回复。


--  作者:view360
--  发布时间:2012/3/15 15:49:00
--  
图片点击可在新窗口打开查看  返回值类指定为月了。。
--  作者:狐狸爸爸
--  发布时间:2012/3/15 16:24:00
--  
有错,应该:
 
If dt.Month = Date.Today.Month AndAlso dt.Day = Date.Today.Day Then

--  作者:cuiler
--  发布时间:2012/3/15 16:45:00
--  
以下是引用狐狸爸爸在2012-3-15 16:24:00的发言:
有错,应该:
 
If dt.Month = Date.Today.Month AndAlso dt.Day = Date.Today.Day Then

 

谢谢,狐狸爸爸。

 

OK,我又抓到一个BUG。

呵呵,我继续看帮助。