IIf(DatePart("h",first(a.CHECKTIME]))<13 And Min(a.CHECKTYPE])="I",first(aI.CHECKTIME]),0) AS 上班1, IIf(DatePart("h",last([aCHECKTIME]))<13 And Max(a.CHECKTYPE])="O",last(a.CHECKTIME]),0) AS 下班1
这样可以取上班1和下班1 不过要分时间段,要几个表才能完成功,非常慢,效果也不好,请教各位大虾,版主,教下在下.