G
Guest
I am creating a maintenance log which will show different parts and its date
installed. It is possible that the same part is changed so the log table
would have the same part name more than one time with different installation
dates. I want to create a query which will enable me to pick a date and see
the configuration on that date, ergo a query which chooses from 'duplicate'
records. To pick a date, the code in criteria i am using is "Between
#1/1/1990# AND [Enter a date:]" which has the user select the day,
essentially searching for all records between those dates. I then want the
query to inspect those entries, and for the duplicate ones, pick the one with
the installation date closest to the user's input for "enter a date".
The 'last' function does not work as it is possible someone will enter a
date for a part that is before the date of installation of another entry for
that same part i.e. the last function goes on chronological order, when the
entry was physically made to the database and not by the value in the date
field. I tried max, but if the maximum value of that field is not within the
selected range of dates, it discards all the rows which are duplicates, which
isn't good.
I am just about out of ideas. Any help anyone???
Tim
installed. It is possible that the same part is changed so the log table
would have the same part name more than one time with different installation
dates. I want to create a query which will enable me to pick a date and see
the configuration on that date, ergo a query which chooses from 'duplicate'
records. To pick a date, the code in criteria i am using is "Between
#1/1/1990# AND [Enter a date:]" which has the user select the day,
essentially searching for all records between those dates. I then want the
query to inspect those entries, and for the duplicate ones, pick the one with
the installation date closest to the user's input for "enter a date".
The 'last' function does not work as it is possible someone will enter a
date for a part that is before the date of installation of another entry for
that same part i.e. the last function goes on chronological order, when the
entry was physically made to the database and not by the value in the date
field. I tried max, but if the maximum value of that field is not within the
selected range of dates, it discards all the rows which are duplicates, which
isn't good.
I am just about out of ideas. Any help anyone???
Tim