I created an expression based on the response in this post
http://www.mrexcel.com/forum/showthread.php?t=243389&highlight=find+previous+records
Unfortunately the expression I created in the query gives me #Error
This expression is part of a query that has the login and logout times for call center agents.
What I want to do is: If the Agent logs out (eventType=7), grab the login time (previous record based on date/time stamp which is eventDateTime is query) for this agent.
Every logout will have a login.
Query = AgentLoggedInTimeQuery
Agents = resourceName
Logout = eventType 7
LoginTime: IIf([eventType]=7,(DLookUp("eventDateTime","AgentLoggedInTimeQuery","resourceName='" & [resourceName] & "' AND eventDateTime=#" & DMax("eventDateTime","AgentLoggedInTimeQuery","resourceName='" & [resourceName] & "'") & "#")),Null)
Any ideas on what I'm doing wrong?
Any help is appreciated.
Thanks,
Gilles
http://www.mrexcel.com/forum/showthread.php?t=243389&highlight=find+previous+records
Unfortunately the expression I created in the query gives me #Error
This expression is part of a query that has the login and logout times for call center agents.
What I want to do is: If the Agent logs out (eventType=7), grab the login time (previous record based on date/time stamp which is eventDateTime is query) for this agent.
Every logout will have a login.
Query = AgentLoggedInTimeQuery
Agents = resourceName
Logout = eventType 7
LoginTime: IIf([eventType]=7,(DLookUp("eventDateTime","AgentLoggedInTimeQuery","resourceName='" & [resourceName] & "' AND eventDateTime=#" & DMax("eventDateTime","AgentLoggedInTimeQuery","resourceName='" & [resourceName] & "'") & "#")),Null)
Any ideas on what I'm doing wrong?
Any help is appreciated.
Thanks,
Gilles