![]() ![]() ![]() ![]() |
|||||
|
|||||
樓主 Mars Jhan ![]()
![]() |
別忘捐VP感謝幫助你的人 | 新手會員瞧一瞧 |
1樓
不錯的參考
P陳 ![]() |
用 VB 來寫的話
1.讀入資料表 放在 Table1 2.一筆筆比對 dim resttime as single for rowii as integer = 0 to table1.rows.count - 2 if datediff("d",table1(rowii)("日期"),table1(rowii+1)("日期")) <>1 then table1(rowii)("間隔")="V" else resttime=24-table1(rowii)("下班時間")+table1(rowii+1)("上班時間") if resttime >12 then table1(rowii)("間隔")="V" else table1(rowii)("間隔")="X" end if end if next 3.資料庫回寫
本篇文章回覆於2018-02-03 07:47
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
2樓
最有價值解答
Hsu,Harry ![]() |
如為2012以上(含)版本, 可使用LEAD/LAG函數, 可直取得前/後期資料,相減即可
http://sqlqna.blogspot.tw/2013/09/laglead.html 如2005、2008版本,則可用ROW_NUMBER()取得前後筆資料,再相減 http://sqlqna.blogspot.tw/2013/09/rownumber.html 範例雖稍有差異,但概念雷同
本篇文章回覆於2018-02-05 10:32
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
回覆 |
如要回應,請先登入. |