Get Top Values per Group using a Subquery in Access ~ DataPig

Поділитися
Вставка
  • Опубліковано 18 жов 2024

КОМЕНТАРІ • 7

  • @rogerburns4356
    @rogerburns4356 6 місяців тому +1

    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

  • @tameraly5367
    @tameraly5367 11 місяців тому +2

    Thank you it is grate code

  • @diegkol
    @diegkol 5 місяців тому +1

    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.

    • @LearnAccessByCrystal
      @LearnAccessByCrystal  5 місяців тому +1

      try something like: Select fieldlist FROM MyChildTable WHERE MyChildTable.ChildID IN (SELECT MyChildTable.ChildID = dMin("ChildID","MyChildTable", "ParentID=" & MyChildTable.ParentID)) ORDER BY fieldlist;

  • @sidharthtewary
    @sidharthtewary 2 роки тому +2

    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

    • @LearnAccessByCrystal
      @LearnAccessByCrystal  2 роки тому +1

      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