Create query columns from similar rows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MC42015
    New Member
    • Sep 2018
    • 22

    Create query columns from similar rows

    Hi - thanks for the read ! I have seen many examples of this but I cannot get it to work for me!
    I hoped that if I plugged in my data someone could shed some light!
    I have a table that is recording shipment data for an order. An order ships, we need to capture that in three fields with an autonumber ID, like this:
    GRID OrderNo(LI Number) ShipDate(Date) GRNo(Short Text)
    1 51056 7/13/2021 SG20210609001
    2 51056 7/13/2021 SG20210609002
    3 51239 9/4/2021 SG-20210904002
    4 51239 9/10/2021 SG-20210910001
    5 51057 5/26/2021 SG-20210526003

    The variables for these records are single date and GRNo per order, mulitple GRNo per order with same date, or multiple GRNo with different dates , and I'm looking to retrieve the info like this:
    OrderNo ShipDate GRNo SD2 GR2
    51056 7/13/2021 SG20210609001 7/13/2021 SG20210609002
    51239 9/4/2021 SG-20210904002 9/10/2021 SG-20210910001
    51057 5/26/2021 SG-20210526003

    Thank you and love to anyone that can teach me how to write this Query!
  • isladogs
    Recognized Expert Moderator Contributor
    • Jul 2007
    • 483

    #2
    Sounds like you need a subquery.
    Have a look at the Get the value in another record example in Allen Browne's article on subqueries: http://allenbrowne.com/subquery-01.html#AnotherRecord

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32661

      #3
      Your example doesn't make it clear what you want from this. Are you looking for a list of all items that match on [OrderNo] or just the Min() & Max() range of them?

      Comment

      Working...