Foxtable(狐表)用户栏目专家坐堂 → [求助]:想做一个员工生日的提醒


  共有6293人关注过本帖树形打印复制链接

主题:[求助]:想做一个员工生日的提醒

帅哥哟,离线,有人找我吗?
狐狸爸爸
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/20 8:53:00 [显示全部帖子]

Dim nms 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
        nms = nms & ",'" & dr("姓名") & "'"
    End If
Next
e.Form.Controls("TextBox1").Value = nms

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/21 14:34:00 [显示全部帖子]

Dim nms As String
For Each dr As DataRow In DataTables("员工登记表格").DataRows
    Dim dt As Date = dr("个人基本资料_出生年月")
    If dt.Month = Date.Today.Month AndAlso dt.Day = Date.Today.Day Then
        nms = nms & ",'" & dr("个人基本资料_姓名") & "'"
    End If
Next
If nms > "" Then
    nms = nms.Trim(",")
    Tables("员工登记表格").filter = "[个人基本资料_姓名] In (" & nms &")"
Else
   Tables("员工登记表格").filter  = "[_Identify] Is Null"
End If
 
 
 
Dim d As Date = Date.Today
Dim y As Integer = d.Year
Dim m As Integer = d.Month
Dim Days As Integer = Date.DaysInMonth(y,m)
Dim fd As Date = New Date(y,m,1) '该月的第一天
Dim ld As Date = New Date(y,m,Days) '该月的最后一天
Dim ids As String
For Each dr As DataRow In DataTables("员工登记表格").DataRows
    Dim dt As Date = dr("个人基本资料_出生年月")
    dt = New Date(Date.Today.Year,dt.Month,dt.Day)
    If dt >= fd AndAlso dt <= ld Then
   ids = ids & "," & dr("_Identify") 
    End If
Next
If ids > "" Then
    ids = ids.Trim(",")
    Tables("员工登记表格").filter = "[_Identify] In (" & ids &")"
else
    Tables("员工登记表格").filter  = "[_Identify] Is Null"
End If

 回到顶部