最新黄网在线观看_丁香一区二区三区_国产精品视区_国内高清免费在线视频

提醒篇--增加學(xué)員生日提醒

2012年03月15日 05:53
點擊率:12833
首先我們先參考數(shù)據(jù)庫字典寫一條提醒,找到學(xué)員表Student里的生日字段Birthday,然后我們使用sql語法編寫查詢語句:
Select
StudentID as 學(xué)號,
StudentName as 姓名
from Student
where Birthday is not null
  and Datepart(month, Birthday) = Datepart(month, getdate())
  and Datepart(day, Birthday) = Datepart(day, getdate())

這個查詢是針對sql數(shù)據(jù)庫版的。

然后就可以增加提醒了,在系統(tǒng)-系統(tǒng)提醒-新建,按下圖所示把語法填寫好:
麥田培訓(xùn)學(xué)校管理軟件細節(jié)

完整的語法:
標    題:生日提醒
提示消息:今天有{0}名學(xué)員過生日了
數(shù)量查詢: 
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 學(xué)號,
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}名學(xué)員過生日了 ,括號里的是數(shù)字零。
2.數(shù)量查詢和展開查詢略有區(qū)別。

    這樣在系統(tǒng)首頁,我們就可以看到提醒了。
麥田培訓(xùn)學(xué)校管理軟件細節(jié)

上面講的是sql數(shù)據(jù)庫版的語法,Access數(shù)據(jù)庫版語法只需要改動兩個參數(shù)即可,如下圖:
麥田培訓(xùn)學(xué)校管理軟件細節(jié)

完整的語法:
標    題:生日提醒
提示消息:今天有{0}名學(xué)員過生日了
數(shù)量查詢: 
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 學(xué)號,
StudentName as 姓名
from Student
where Birthday is not null
  and DATEPART('M', Birthday) = DATEPART('M', now())
  and DATEPART('d', Birthday) = DATEPART('d', now())


主站蜘蛛池模板: 长治县| 宁都县| 长沙县| 阿克陶县| 寿宁县| 宜良县| 东方市| 长沙县| 内黄县| 调兵山市| 龙井市| 娄烦县| 谢通门县| 丽江市| 太康县| 金山区| 阿拉尔市| 广东省| 永德县| 昂仁县| 南溪县| 花莲市| 游戏| 鄂托克旗| 赤壁市| 山东省| 博爱县| 毕节市| 斗六市| 新兴县| 安福县| 南投市| 常德市| 新津县| 洪湖市| 宝鸡市| 昭觉县| 卢龙县| 延川县| 顺平县| 尚志市|