以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]:想做一个员工生日的提醒 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=34930) |
-- 作者:benhu -- 发布时间:2013/6/19 16:13:00 -- [求助]:想做一个员工生日的提醒 有一个“员工登记表格”,想系统打开后自动刷新员工生日的提醒, |
-- 作者:Bin -- 发布时间:2013/6/19 16:16:00 -- 参考帮助 http://www.foxtable.com/help/topics/2476.htm TextBox显示人数参考帮助 http://www.foxtable.com/help/topics/0393.htm
|
-- 作者:benhu -- 发布时间:2013/6/20 8:08:00 -- 谢谢!BIN。用按键按帮助的参考和计算这些我会做,我只是想换个方式。 最主要的是,搜索出来的值显示,但对于“员工登记表”中的其它数据不会隐身,也就是只是取值,不影响任何动作。
[此贴子已经被作者于2013-6-20 8:13:01编辑过]
|
-- 作者:Bin -- 发布时间:2013/6/20 8:53:00 -- 原理是一样的,换个呈现的方式一样是这么做的啊. |
-- 作者:狐狸爸爸 -- 发布时间: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 |
-- 作者:benhu -- 发布时间:2013/6/20 10:31:00 -- 可能是我没描述得清楚,不过我现在搞定了,在事件中加多一个打开时隐藏列,退出时取消隐藏列就可以了,谢谢!! |
-- 作者:benhu -- 发布时间:2013/6/21 14:28:00 -- [求助]帮忙看下是否代码有误,谢谢!! 各位高手,麻烦帮忙看下代码有没写错,出现两个问题,会不会与试用版有关: 1:今天生日时,如果没有这一天的,那么不是属于这一天的生日都搜出来了,如果有,则搜索的结果没问题? 2:本月生日时,最后一天搜不出来。 今天生日提醒: 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 &")" 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 &")" End If |
-- 作者:狐狸爸爸 -- 发布时间: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 |
-- 作者:don -- 发布时间:2013/6/21 15:17:00 -- \'日本 Dim flt As String = Format(Date.Today,"d").Replace(Format(Date.Today,"yyy"),"") & " " flt = "Convert([个人基本资料_出生年月], \'System.String\') Like \'%" & flt & "%\'" Tables("员工登记表格").filter = flt \'月本 Dim flt As String 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) \'该月的最后一天 flt = "[个人基本资料_出生年月] >=#" & fd & "# and [个人基本资料_出生年月] <=#" & ld & "#" Tables("员工登记表格").filter = flt
[此贴子已经被作者于2013-6-21 15:17:24编辑过]
|
-- 作者:benhu -- 发布时间:2013/6/21 15:50:00 -- 回复:(狐狸爸爸)Dim nms As StringFor Each dr A... 今天的提醒加了否定取值可以了,但月度的还是不行 |