Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a Query to Select the latest update to a data series 1

Status
Not open for further replies.

postlethwaited

Technical User
Apr 18, 2006
11
GB
Good Morning, I have a table of data where the same system number may occur more than once. I would like to select only the rows which have the highest life-cycle reference for each system number. Is this possible?
 
Yes, it's possible, but you will need to give more info. What is the structure of the table you want to get this data from? Which field in said table is the "life-cycle reference", and which one is the "system number"?
 
Perhaps something like:

[tt]SELECT Table1.Field1, Table1.Field2
FROM Table1
WHERE Table1.Field2 =
(SELECT Max(Field2) from Table1 X
WHERE Table1.Field1 = X.Field1);[/tt]

There is a dedicated forum for queries:
Microsoft: Access Queries and JET SQL Forum
forum701
 
thanks guys, to be honest i was trying not to code this and use just one query - i am not sure if it is possible. the structure of the table is as follows:

FIELD ONE FIELD TWO ALL OTHER DATA
(SYSTEM NO) (LIFE CYCLE)

445566 10345678
445566 10345679 **
436574 10456493
436574 10456496 **

I would want to select the two marked records - like i say not sure if it possible, but appreciate your efforts!
 
What I posted is one query, SQL view, that selects the two marked rows.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top