caradri Posted July 14, 2016 Share Posted July 14, 2016 Hi all. I need help with a query. I need the whole last entry from table A for each item on table B. Thanks for any help. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 14, 2016 Share Posted July 14, 2016 You need to use a join, you can specify the conditions when you join the tables. Link to comment Share on other sites More sharing options...
caradri Posted July 17, 2016 Author Share Posted July 17, 2016 You need to use a join, you can specify the conditions when you join the tables. Thanks for reply. I have this SELECT Manager.MasterID, Manager.TakeOutUserID, Manager.TakeOutDate, Manager.TakeOutComment, Manager.ReturnUserID, Manager.ReturnDate, Manager.ReturnComment, Manager.Status, Masters.PartNumber, Masters.Comment, Masters.Revision, Masters.Location, Masters.LastUse FROM (Manager INNER JOIN Masters ON Masters.SerialNumber = Manager.MasterID) but I don't know how to select the last(newest) entry on Manager for each Master table entry. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 18, 2016 Share Posted July 18, 2016 You can use MAX to get the largest value of a column in a table, so you'll need a column that increments with each record, or a date/time value that corresponds with entry date. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now