J
Joseph Rosing
Hi,
I have two date/time fields: StartTime and LastActivity.
In the History table, there are Location and LastActivity fields.
I want to run a query which finds the LastActivity date/time closest to
the StartTime and returns the Location for that LastActivity date/time.
In summary, I want to return the location of a part at the specified
StartTime.
The code I'm using in the calculated field is below which returns a
#Error message in the StartLoc column.
StartLoc:
DLookUp([LOCATION],[HISTORY]![LOCATION],"[LASTACTIVITY]=#" &
DMax([LASTACTIVITY] & "#",[HISTORY]![LASTACTIVITY],"[LASTACTIVITY]<=#"
& "[KitStartTime]" & "#"))
Thus, the query looks up the maximum LastActivity time which is less
than or equal to the StartTime and returns the Location where
LastActivity equals that maximum LastActivity (or so I wish).
I have the domain fields set to be
![Field] because when I set
them to just
, the query asks me for the parameter before it
runs. I've tried splitting up the functions and working them one at a
time but to no avail.
Thanks for any help.
Joe
I have two date/time fields: StartTime and LastActivity.
In the History table, there are Location and LastActivity fields.
I want to run a query which finds the LastActivity date/time closest to
the StartTime and returns the Location for that LastActivity date/time.
In summary, I want to return the location of a part at the specified
StartTime.
The code I'm using in the calculated field is below which returns a
#Error message in the StartLoc column.
StartLoc:
DLookUp([LOCATION],[HISTORY]![LOCATION],"[LASTACTIVITY]=#" &
DMax([LASTACTIVITY] & "#",[HISTORY]![LASTACTIVITY],"[LASTACTIVITY]<=#"
& "[KitStartTime]" & "#"))
Thus, the query looks up the maximum LastActivity time which is less
than or equal to the StartTime and returns the Location where
LastActivity equals that maximum LastActivity (or so I wish).
I have the domain fields set to be
them to just
runs. I've tried splitting up the functions and working them one at a
time but to no avail.
Thanks for any help.
Joe