ndornack
asked on
Data type mismatch in criteria expression
I am using Access 2003 and getting an error in a query: (see attached file)
Data type mismatch in criteria expression
for the query "qryInOutFinal"
What is wrong?
InOut.mdb
Data type mismatch in criteria expression
for the query "qryInOutFinal"
What is wrong?
InOut.mdb
ASKER
I tried this and now the query (qryInOutFinal) doesn't return any data. What happened now?
InOut.mdb
InOut.mdb
THere's an extra space which must be removed...
WHERE (((DCount("*","qryInOut00" ,"[EmpNum] =' " & ......
should be..
WHERE (((DCount("*","qryInOut00" ,"[EmpNum] ='" & ....
No space between the single ' and the "
WHERE (((DCount("*","qryInOut00"
should be..
WHERE (((DCount("*","qryInOut00"
No space between the single ' and the "
ASKER
I am trying to capture the punch out time of the next record. Attached is a spreadsheet with column I showing what I am looking for.
Also attached is the latest .mdb file for performing this query in "qryInOutFinal"
clockexample.xls
InOut.mdb
Also attached is the latest .mdb file for performing this query in "qryInOutFinal"
clockexample.xls
InOut.mdb
Did you try Pete's suggestion of removing the extra space? That was a typo in the query I posted earlier:
SELECT qryInOut00.ID, qryInOut00.EmpNum, tblPunches.PunchDate, qryInOut00.PunchDT, DMin("PunchDT","qryInOut00","[EmpNum] ='" & [qryInOut00].[EmpNum] & "' And [PunchDT] > #" & Format([qryInOut00].[PunchDT],"mm\/dd\/yyyy hh:nn") & "#") AS TNext
FROM qryInOut00 INNER JOIN tblPunches ON qryInOut00.ID = tblPunches.ID
WHERE (((DCount("*","qryInOut00","[EmpNum] ='" & [qryInOut00].[EmpNum] & "' And [PunchDT] <= #" & Format([qryInOut00].[PunchDT],"mm\/dd\/yyyy hh:nn") & "#") Mod 2)=1));
ASKER
Yes, I removed the extra space. That s/b reflected in the .mdb I posted above. I need to have the data return like you see in column I of the spreadsheet.
try what I posted please I think you missed one of the spaces.
ASKER
see attached without the space. The data in query qryInOutFinal needs to show as in column I of the attached spreadsheet.
InOut.mdb
InOut.mdb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works perfectly, thanks.
Open in new window