help regarding this query

icemonster

Registered User.
Local time
Yesterday, 18:19
Joined
Jan 30, 2010
Messages
502
Code:
SELECT [EMP ID], [DATE], [TIME], 
(Select count(*) from [tblPunchCard] where [EMP ID] = a.[EMP ID] and [Date]+[Time] <= a.[Date]+a.[Time]) AS Num, 
iif(Num mod 2 =1, "In" ,"Out") AS InOut, 
iif(InOut="In", Num, Num-1) AS Pair
FROM [tblPunchCard] AS a;

i found this code on this site and i am trying to understand it, basically what i am trying to do is that don't assign an out or don't pair the records if their dates are not equal.

any help is appreciated.
 

Users who are viewing this thread

Back
Top Bottom