時間求和函數,時間求差函,20020201 像這樣的格式 計算可來蠻麻煩.
假如時間函數:dbo.f_sumtime dbo.f_subtime
userinfotable as a
workinfotable as b
建下面的視圖
select a.username,dbo.f_subtime(dbo.f_sumtime(b.startime),dbo.f_subtime(b.endtime)) as gl from a,b where a.userid=b.userid
--
gl 就是妳要的條件了
思路就是這樣了.