监理公司管理系统 | 工程企业管理系统 | OA系统 | ERP系统 | 造价咨询管理系统 | 工程设计管理系统 | 甲方项目管理系统 | 签约案例 | 客户案例 | 在线试用
X 关闭
培训管理系统

当前位置:工程项目OA系统 > 学校OA管理系统 > 相关系统 > 培训管理系统

应用篇--增加学员生日提醒

申请免费试用、咨询电话:400-8352-114

首先我们先参考数据库字典写一条提醒,找到学员表Student里的生日字段Birthday,然后我们使用sql语法编写查询语句:
Select
StudentID as 学号,
StudentName as 姓名
from Student
where Birthday is not null
  and Datepart(month, Birthday) = Datepart(month, getdate())
  and Datepart(day, Birthday) = Datepart(day, getdate())

这个查询是针对sql数据库版的。

然后就可以增加提醒了,在系统-系统提醒-新建,按下图所示把语法填写好:


完整的语法:
标    题:生日提醒
提示消息:今天有{0}名学员过生日了
数量查询: 
Select
Count(*)
from Student
where Birthday is not null
  and DATEPART(month, Birthday) = DATEPART(month, getdate())
  and DATEPART(day, Birthday) = DATEPART(day, getdate()) 

展开查询:
Select
StudentID as 学号,
StudentName as 姓名
from Student
where Birthday is not null
  and DATEPART(month, Birthday) = DATEPART(month, getdate())
  and DATEPART(day, Birthday) = DATEPART(day, getdate())

这里需要注意的是:
1.提示消息:今天有{0}名学员过生日了 ,括号里的是数字零。
2.数量查询和展开查询略有区别。

    这样在系统首页,我们就可以看到提醒了。


上面讲的是sql数据库版的语法,Access数据库版语法只需要改动两个参数即可,如下图:


完整的语法:
标    题:生日提醒
提示消息:今天有{0}名学员过生日了
数量查询: 
Select
Count(*)
from Student
where Birthday is not null
  and DATEPART('M', Birthday) = DATEPART('M', now())
  and DATEPART('d', Birthday) = DATEPART('d', now()) 

展开查询:
Select
StudentID as 学号,
StudentName as 姓名
from Student
where Birthday is not null
  and DATEPART('M', Birthday) = DATEPART('M', now())
  and DATEPART('d', Birthday) = DATEPART('d', now())


发布:2007-03-30 09:50    编辑:泛普软件 · xiaona    [打印此页]    [关闭]