R
Robyn
I copied this query from a post and modified table & field names:
SELECT T.EmpID,
(IIf([ClockIn]=True,"Clock In","Clock Out")) AS ClockType,
(IIf([ClockIn]=True, Null, DateDiff("n",Nz(
(SELECT Max(Q.[TimeStamp]) FROM
TimeSheet AS Q
WHERE Q.ClockIn = True AND
Q.TimeStamp < T.[TimeStamp]),0), T.[TimeStamp]))
FROM TimeSheet AS T;
I'm trying to use it in a query and I get the following error message:
The syntax of the subquery in this expression is incorrect. check the
subquery's syntax and enclose the subquery in parentheses.
I want to use this to calculate elapsed time. The table in which my form is
based has the following fields:
Table Name: TimeSheet
EmpID (Text)
ClockIn (Yes/No)
TimeStamp (Date/Time)
As for the Form:
Form Name: TimeSheet
TimeStamp default value: =Now()
ClockIn default value: =[Me].[Frame6].[Value]=Null
SELECT T.EmpID,
(IIf([ClockIn]=True,"Clock In","Clock Out")) AS ClockType,
(IIf([ClockIn]=True, Null, DateDiff("n",Nz(
(SELECT Max(Q.[TimeStamp]) FROM
TimeSheet AS Q
WHERE Q.ClockIn = True AND
Q.TimeStamp < T.[TimeStamp]),0), T.[TimeStamp]))
FROM TimeSheet AS T;
I'm trying to use it in a query and I get the following error message:
The syntax of the subquery in this expression is incorrect. check the
subquery's syntax and enclose the subquery in parentheses.
I want to use this to calculate elapsed time. The table in which my form is
based has the following fields:
Table Name: TimeSheet
EmpID (Text)
ClockIn (Yes/No)
TimeStamp (Date/Time)
As for the Form:
Form Name: TimeSheet
TimeStamp default value: =Now()
ClockIn default value: =[Me].[Frame6].[Value]=Null