473,289 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

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!
Sep 14 '21 #1
2 8257
isladogs
454 Expert Mod 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
Sep 14 '21 #2
NeoPa
32,554 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?
Sep 21 '21 #3

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

Similar topics

3
by: helpful sql | last post by:
Hi all, I am using an HTML table control on my ASP.Net page. Now I need to change this table so that columns become rows and rows become column. Since the table is very complex with many controls...
1
by: Sergiu Cojocaru | last post by:
Ia have a query that returns a variable number of columns. How can I create these columns in Crystal?
0
by: helpful sql | last post by:
Hi all, I am using an HTML table control on my ASP.Net page. Now I need to change this table so that columns become rows and rows become column. Since the table is very complex with many controls...
5
by: Anand | last post by:
Greetings, How can I find the number of active columns and rows used in an excel work sheet? What I mean is how can i find the last column and row or cell position, where the data is stored in...
0
by: vinod | last post by:
hi experts, is it possible to view a table rows as columns and columns as rows? thnnk you in advance
6
Vasuki Masilamani
by: Vasuki Masilamani | last post by:
Hi, I need a query which would convert Columns into Rows without causing any damages to the original data. I am not supposed to solve this by creating temporary tables and later dropping it. I...
3
by: Shivakumar | last post by:
Dear Friends, I want to show columns into rows. For example, I have a table, TIMESHEET, with the following structure: CREATE TABLE TIMESHEET ( EMPNO CHAR(3), WEEKEND_DATE DATE,...
4
by: muhammadrashidmughal | last post by:
columns f1 f2 f2 f4 f5 f6 f7 f8 ...... 1 2 3 4 ...
3
by: Yaridovich | last post by:
Hello everyone, I'm trying to come up with a query that removes rows where a certain column has the same value (for instance, the column's value is the same in rows #503, #677 and #1020). There...
1
by: ricky | last post by:
Hi, I have some procedures with dynamic sql(generic procedure for different tables) to do the convert columns to rows but have performance issue. Is there a better way like a single SQL that can...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.