Almost what I need. I need help please. Example: [ParentID] is the same in multiple rows with different [ChildID] in each row. The Query should list [ParnetID] with only one child, based on the lowest number of [ChildID]. So basically a parent with the oldest child (based on ChildID, the child id is unique so the oldest child should actually have the lowest id number). Help would be appreciated.
try something like: Select fieldlist FROM MyChildTable WHERE MyChildTable.ChildID IN (SELECT MyChildTable.ChildID = dMin("ChildID","MyChildTable", "ParentID=" & MyChildTable.ParentID)) ORDER BY fieldlist;
it looks like it should work IF each employee is assigned to specific customers. If not, better however would be to specify criteria such that the result won't possibly be duplicated for another such as using a numeric key. That's one reason I like to always have an AutoNumber. If nothing is shown (blank) then nothing matches if criteria is correct
Thank you it was exactly what I was looking for and works just fine and although not instant does produce a perfect report from the query
Thank you it is grate code
You are welcome
Almost what I need. I need help please. Example: [ParentID] is the same in multiple rows with different [ChildID] in each row. The Query should list [ParnetID] with only one child, based on the lowest number of [ChildID]. So basically a parent with the oldest child (based on ChildID, the child id is unique so the oldest child should actually have the lowest id number). Help would be appreciated.
try something like: Select fieldlist FROM MyChildTable WHERE MyChildTable.ChildID IN (SELECT MyChildTable.ChildID = dMin("ChildID","MyChildTable", "ParentID=" & MyChildTable.ParentID)) ORDER BY fieldlist;
This doesn’t work on ms access 16. M not sure if I’m not doing it correctly or some other issue. It just shows blank table
it looks like it should work IF each employee is assigned to specific customers. If not, better however would be to specify criteria such that the result won't possibly be duplicated for another such as using a numeric key. That's one reason I like to always have an AutoNumber.
If nothing is shown (blank) then nothing matches if criteria is correct