469,156 Members | 2,147 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,156 developers. It's quick & easy.

Create query columns from similar rows

22
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!
1 Week Ago #1
2 4929
isladogs
289 Expert 256MB
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
1 Week Ago #2
NeoPa
32,165 Expert Mod 16PB
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?
6 Days Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by helpful sql | last post: by
1 post views Thread by Sergiu Cojocaru | last post: by
reply views Thread by helpful sql | last post: by
5 posts views Thread by Anand | last post: by
3 posts views Thread by Shivakumar | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.