SQL又是很簡單的問題 access

2006-10-28 7:44 pm
"Select date as 日期,time as 時間,content as 活動或工作,place as 地點,controller as 負責人,remark as 出席者 from schdaybook where date>=date() order by date"

我想問點樣可以單單選擇
1.大於或等於今日
2.今個星期內
3.今個月內
4.今年內

謝謝,我是用access的

回答 (1)

2006-10-28 8:16 pm
✔ 最佳答案
可以用 date function.. 成句我唔打喇... 淨係打 where clause:

1. where datediff ("d", date, date()) >= 0)
2. where datediff ("ww", date, date()) = 0)
3. where datediff ("m", date, date()) = 0)
4. where datediff ("yyyy", date, date()) = 0)

如此類推.... 不過... 我D syntax 可能有錯 ^^:... 手上冇 Access verify 唔到..


收錄日期: 2021-04-13 15:15:41
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20061028000051KK01388

檢視 Wayback Machine 備份