以下是引用muhua在2012-12-24 14:45:00的发言:
Dim ids As String
Dim n As Integer = 9 '未来天数,含今天,所以实际是未来7天
For Each dr As DataRow In DataTables("员工").DataRows
Dim birthday As Date
If dr("生日").Month = 1 AndAlso dr("生日").Day < 9 Then
birthday = Cdate(Date.Today.AddYears(1).Year & "-" & dr("生日").Month & "-" & dr("生日").Day)
Else
birthday = Cdate(Date.Today.Year & "-" & dr("生日").Month & "-" & dr("生日").Day)
End If
Dim t As TimeSpan = birthday - Date.Today
If t.Days >0 AndAlso t.Days < 9 Then
'If (dt1 >= Date.Today AndAlso dt1 < Date.Today.AddDays(n)) OrElse (dt2 >= Date.Today AndAlso dt2 < Date.Today.AddDays(n)) Then
ids = ids & "," & dr("姓名")
End If
Next
If ids > "" Then
ids = ids.Trim(",")
messagebox.show("未来"& n &"天内是" & ids & "的生日,给他们送去祝福吧.","生日提醒")
'Tables("员工").filter = "[_Identify] In (" & ids &")"
End If
[此贴子已经被作者于2012-12-24 15:17:16编辑过]
muhua 你修改了哪里呀