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

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
 
L

Lynn Trapp

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.
 
G

Guest

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.
 
L

Lynn Trapp

You would either need to manually set the value of the flag or, else, use
code in the AfterUpdate event of your form.
 
G

Guest

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top