Title is suppose to be closest matching fields not closed.
Hello.
It may be easiest to just view my attached example database. I have three tables of which two are mostly relevant. A KnownDirections table and NeededDirections.
I need to copy the value from the Direction field in the KnownDirection table into the Direction field in the NeededDirections table, where that record is chosen based on where the Depth fields are the closest between the two tables.
I need it in a select query so that I can do further calculations with it (I think).
EDIT: I have mislabeled fields in my tables and can't change the database. intDistance is supposed to be intDepth so there are depth fields in each table.
I really don't know if I need DLookup or if the query does that for me? I have tried using DMin to find the minimum difference between the depths and then using the corresponding Direction but I'm still learning SQL and don't really know where to start with the syntax. I have this working nicely in excel but access is giving me a tougher time. My excel formula uses INDEX(MATCH(MIN(ABS ... etc.
Any help is greatly appreciated.
Thank you.