How to find the most recent product (using group,last and first)

  • Thread starter Thread starter KillMeTwice
  • Start date Start date
K

KillMeTwice

I am working with a production system, but now I have a need to filter
out only the newest version of a product (to export it to the sale/
logistic-system). I have tried using Grouping, Last or First in a
query, but find that sorting has no effect. The only thing that seems
to me to control what is first and last is the time of the recording
of the record.

I have tried sorting a query and using this as source for grouping -
with no effect.

Sincerely

Hans Kristian Eide
 
Do you have a date field that identifies which record is the last version of
the product? Or do you propose to identifiy it some other way? One good way
would be to have a field called 'Current Version' that you could then filter
by.
 
I am having the same issue. If I use a separate field to flag each entry in
the child table as either the "current" or "latest" entry, how do I control
the flagging? I have tried the SetValue function a few different ways and
can't seem to get it to work right.
 
You would either need to manually set the value of the flag or, else, use
code in the AfterUpdate event of your form.
 
Yes, I do have a timestamp field and I tried to filter using the "select"
function someone posted earlier, SELECT(MAX([timestamp]) FROM
ProjectHistory_tbl)" is the incorrect syntax. ProjectHistory_tbl is the name
of the child table which contains the status that I would like the
most-recent update of.
 
But this may not help. If I catch tha time the record was made I will have
the same result as using last and first. If i catch the time of update I
cannot be sure the last version was last updated.

I think the flag-idea is the only possible one. The users have to say which
version is the current one.

Thank you

Hans Kristian Eide
 
Back
Top