积极答复者
获取mysql的日期

问题
答案
-
這個方式我不會,也許有其它高手可給您建議!
但我想如果沒上班一樣把資料存入,多開個欄位記憶是否有上班,這樣蒐尋的時候只要搜尋那個欄位有值的count數就知道他缺席幾天了,我是這樣做的,覺得挺方便的,給您參考
coding or not- 已标记为答案 ckjason 2011年10月31日 2:44
- 取消答案标记 ckjason 2011年10月31日 2:44
- 已建议为答案 Mike FengModerator 2011年11月1日 18:42
- 已标记为答案 Mike FengModerator 2011年11月13日 6:50
-
我同意Shinyo的看法。举个例子:
程晋 8:00 17:00 2011-8-11 是
程晋 8:00 17:00 2011-8-12 否
程晋 8:00 17:00 2011-8-13 是
程晋 8:00 17:00 2011-8-14 否
这样你在算8月份的缺勤天数时, select count(是否上班栏位) from 你的表 where 日期>= 2010-08-01 and 日期 <= 2010-08-31 and 是否上班栏位 = 否
起始日期和结束日期肯定都由你程序输入,这样就很容易得到一个月的起始日期和结束日期。
Best regards,
Mike Feng [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
建个表,保存所有上班日期,难道mysql 没有 not in 语句
http://feiyun0112.cnblogs.com/- 已标记为答案 Mike FengModerator 2011年11月13日 6:51
全部回复
-
這個方式我不會,也許有其它高手可給您建議!
但我想如果沒上班一樣把資料存入,多開個欄位記憶是否有上班,這樣蒐尋的時候只要搜尋那個欄位有值的count數就知道他缺席幾天了,我是這樣做的,覺得挺方便的,給您參考
coding or not- 已标记为答案 ckjason 2011年10月31日 2:44
- 取消答案标记 ckjason 2011年10月31日 2:44
- 已建议为答案 Mike FengModerator 2011年11月1日 18:42
- 已标记为答案 Mike FengModerator 2011年11月13日 6:50
-
-
我同意Shinyo的看法。举个例子:
程晋 8:00 17:00 2011-8-11 是
程晋 8:00 17:00 2011-8-12 否
程晋 8:00 17:00 2011-8-13 是
程晋 8:00 17:00 2011-8-14 否
这样你在算8月份的缺勤天数时, select count(是否上班栏位) from 你的表 where 日期>= 2010-08-01 and 日期 <= 2010-08-31 and 是否上班栏位 = 否
起始日期和结束日期肯定都由你程序输入,这样就很容易得到一个月的起始日期和结束日期。
Best regards,
Mike Feng [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
我同意Shinyo的看法。举个例子:
程晋 8:00 17:00 2011-8-11 是
程晋 8:00 17:00 2011-8-12 否
程晋 8:00 17:00 2011-8-13 是
程晋 8:00 17:00 2011-8-14 否
这样你在算8月份的缺勤天数时, select count(是否上班栏位) from 你的表 where 日期>= 2010-08-01 and 日期 <= 2010-08-31 and 是否上班栏位 = 否
起始日期和结束日期肯定都由你程序输入,这样就很容易得到一个月的起始日期和结束日期。
Best regards,
Mike Feng [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
你可以加上这么一个栏位的.
难道是 现在这个系统已经完全设计好了,老板只要你根据现有栏位查出缺勤天数??
Mike Feng [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
你可以加上这么一个栏位的.
难道是 现在这个系统已经完全设计好了,老板只要你根据现有栏位查出缺勤天数??
Mike Feng [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
我同意Shinyo的看法。举个例子:
程晋 8:00 17:00 2011-8-11 是
程晋 8:00 17:00 2011-8-12 否
程晋 8:00 17:00 2011-8-13 是
程晋 8:00 17:00 2011-8-14 否
这样你在算8月份的缺勤天数时, select count(是否上班栏位) from 你的表 where 日期>= 2010-08-01 and 日期 <= 2010-08-31 and 是否上班栏位 = 否
起始日期和结束日期肯定都由你程序输入,这样就很容易得到一个月的起始日期和结束日期。
Best regards,
Mike Feng [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
建个表,保存所有上班日期,难道mysql 没有 not in 语句
http://feiyun0112.cnblogs.com/- 已标记为答案 Mike FengModerator 2011年11月13日 6:51