
加好友 发短信
等级:小狐
帖子:381
积分:3462
威望:0
精华:0
注册:2011/5/9 12:45:00
|
生日提醒中判断条件不明白? Post By:2015/12/2 10:44:00 [只看该作者]
Dim ids As String Dim n As Integer = 6 '未来天数,含今天,所以实际是未来7天 For Each dr As DataRow In DataTables("员工").DataRows Dim dt As Date = dr("出生日期") Dim dt1 As New Date(Date.Today.Year,dt.Month,dt.Day) Dim dt2 As New Date(Date.Today.AddDays(n).Year,dt.Month,dt.Day) If (dt1 >= Date.Today AndAlso dt1 < Date.Today.AddDays(n)) OrElse (dt2 >= Date.Today AndAlso dt2 < Date.Today.AddDays(n)) Then ids = ids & "," & dr("_Identify") End If Next If ids > "" Then ids = ids.Trim(",") Tables("员工").filter = "[_Identify] In (" & ids &")" End If
我认为红色的代码没必要加 ,只用绿色的不就行吗?
|
|