Combine different lines to display beside each other

Tcurtis

Board Regular
Joined
Aug 15, 2009
Messages
149
I am not sure how to ask this question. I want to display two different date fields of data beside each other. They have the same unique serial number/barcode and the dates are on separate lines. I want to display them on the same line beside each other. The first example shows how the data looks. The second shows how I want to display it. How do I move the dates side by side?

[TABLE="width: 258"]
<colgroup><col width="94" style="width: 71pt; mso-width-source: userset; mso-width-alt: 3356;"> <col width="73" style="width: 55pt; mso-width-source: userset; mso-width-alt: 2588;"> <col width="76" style="width: 57pt; mso-width-source: userset; mso-width-alt: 2702;"> <col width="100" style="width: 75pt; mso-width-source: userset; mso-width-alt: 3555;"> <tbody>[TR]
[TD="width: 94, bgcolor: transparent"]RA_Num[/TD]
[TD="width: 73, bgcolor: transparent"]BarCode[/TD]
[TD="width: 76, bgcolor: transparent"]Date_Ent[/TD]
[TD="width: 100, bgcolor: transparent"]Date_Warranty[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS07030128[/TD]
[TD="bgcolor: transparent"]A-236639[/TD]
[TD="bgcolor: transparent, align: right"]7/3/2018[/TD]
[TD="bgcolor: transparent, align: right"]4/5/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05240124[/TD]
[TD="bgcolor: transparent"]A-236639[/TD]
[TD="bgcolor: transparent, align: right"]5/24/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS12200076[/TD]
[TD="bgcolor: transparent"]A-325542[/TD]
[TD="bgcolor: transparent, align: right"]12/20/2018[/TD]
[TD="bgcolor: transparent, align: right"]4/15/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05290139[/TD]
[TD="bgcolor: transparent"]A-325542[/TD]
[TD="bgcolor: transparent, align: right"]5/29/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT04100249[/TD]
[TD="bgcolor: transparent"]A-334869[/TD]
[TD="bgcolor: transparent, align: right"]4/10/2019[/TD]
[TD="bgcolor: transparent, align: right"]5/21/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05280281[/TD]
[TD="bgcolor: transparent"]A-334869[/TD]
[TD="bgcolor: transparent, align: right"]5/28/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS08280184[/TD]
[TD="bgcolor: transparent"]A-335663[/TD]
[TD="bgcolor: transparent, align: right"]8/28/2018[/TD]
[TD="bgcolor: transparent, align: right"]1/31/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT02060109[/TD]
[TD="bgcolor: transparent"]A-335663[/TD]
[TD="bgcolor: transparent, align: right"]2/6/2019[/TD]
[TD="bgcolor: transparent, align: right"]3/28/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT02190119[/TD]
[TD="bgcolor: transparent"]A-335757[/TD]
[TD="bgcolor: transparent, align: right"]2/19/2019[/TD]
[TD="bgcolor: transparent, align: right"]3/14/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT03190145[/TD]
[TD="bgcolor: transparent"]A-335757[/TD]
[TD="bgcolor: transparent, align: right"]3/19/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/22/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS12280034[/TD]
[TD="bgcolor: transparent"]A-335780[/TD]
[TD="bgcolor: transparent, align: right"]12/28/2018[/TD]
[TD="bgcolor: transparent, align: right"]3/8/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT03220089[/TD]
[TD="bgcolor: transparent"]A-335780[/TD]
[TD="bgcolor: transparent, align: right"]3/22/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/30/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT03010142[/TD]
[TD="bgcolor: transparent"]A-336952[/TD]
[TD="bgcolor: transparent, align: right"]3/1/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/29/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT06050101[/TD]
[TD="bgcolor: transparent"]A-336952[/TD]
[TD="bgcolor: transparent, align: right"]6/5/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT01070052[/TD]
[TD="bgcolor: transparent"]A-358773[/TD]
[TD="bgcolor: transparent, align: right"]1/7/2019[/TD]
[TD="bgcolor: transparent, align: right"]5/28/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05280161[/TD]
[TD="bgcolor: transparent"]A-358773[/TD]
[TD="bgcolor: transparent, align: right"]5/28/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT01180090[/TD]
[TD="bgcolor: transparent"]A-360215[/TD]
[TD="bgcolor: transparent, align: right"]1/18/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/26/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05020219[/TD]
[TD="bgcolor: transparent"]A-360215[/TD]
[TD="bgcolor: transparent, align: right"]5/2/2019[/TD]
[TD="bgcolor: transparent, align: right"]5/22/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS09060234[/TD]
[TD="bgcolor: transparent"]A-360451[/TD]
[TD="bgcolor: transparent, align: right"]9/6/2018[/TD]
[TD="bgcolor: transparent, align: right"]2/20/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT03010097[/TD]
[TD="bgcolor: transparent"]A-360451[/TD]
[TD="bgcolor: transparent, align: right"]3/1/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/18/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT01300086[/TD]
[TD="bgcolor: transparent"]A-360666[/TD]
[TD="bgcolor: transparent, align: right"]1/30/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/25/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05120051[/TD]
[TD="bgcolor: transparent"]A-360666[/TD]
[TD="bgcolor: transparent, align: right"]5/12/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT01210130[/TD]
[TD="bgcolor: transparent"]A-362214[/TD]
[TD="bgcolor: transparent, align: right"]1/21/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/23/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT04240052[/TD]
[TD="bgcolor: transparent"]A-362214[/TD]
[TD="bgcolor: transparent, align: right"]4/24/2019[/TD]
[TD="bgcolor: transparent, align: right"]5/20/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05220057[/TD]
[TD="bgcolor: transparent"]A-362214[/TD]
[TD="bgcolor: transparent, align: right"]5/22/2019[/TD]
[TD="bgcolor: transparent"]
[/TD]
[/TR]
</tbody>[/TABLE]


[TABLE="width: 263"]
<colgroup><col width="99" style="width: 74pt; mso-width-source: userset; mso-width-alt: 3527;"> <col width="76" style="width: 57pt; mso-width-source: userset; mso-width-alt: 2702;" span="2"> <col width="100" style="width: 75pt; mso-width-source: userset; mso-width-alt: 3555;"> <tbody>[TR]
[TD="width: 99, bgcolor: transparent"]RA_Num[/TD]
[TD="width: 76, bgcolor: transparent"]BarCode[/TD]
[TD="width: 76, bgcolor: transparent"]Date_Ent[/TD]
[TD="width: 100, bgcolor: transparent"]Date_Warranty[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS07030128[/TD]
[TD="bgcolor: transparent"]A-236639[/TD]
[TD="bgcolor: transparent, align: right"]7/3/2018[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05240124[/TD]
[TD="bgcolor: transparent"]A-236639[/TD]
[TD="bgcolor: transparent, align: right"]5/24/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/5/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS12200076[/TD]
[TD="bgcolor: transparent"]A-325542[/TD]
[TD="bgcolor: transparent, align: right"]12/20/2018[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05290139[/TD]
[TD="bgcolor: transparent"]A-325542[/TD]
[TD="bgcolor: transparent, align: right"]5/29/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/15/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT04100249[/TD]
[TD="bgcolor: transparent"]A-334869[/TD]
[TD="bgcolor: transparent, align: right"]4/10/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05280281[/TD]
[TD="bgcolor: transparent"]A-334869[/TD]
[TD="bgcolor: transparent, align: right"]5/28/2019[/TD]
[TD="bgcolor: transparent, align: right"]5/21/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS08280184[/TD]
[TD="bgcolor: transparent"]A-335663[/TD]
[TD="bgcolor: transparent, align: right"]8/28/2018[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT02060109[/TD]
[TD="bgcolor: transparent"]A-335663[/TD]
[TD="bgcolor: transparent, align: right"]2/6/2019[/TD]
[TD="bgcolor: transparent, align: right"]1/31/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT02190119[/TD]
[TD="bgcolor: transparent"]A-335757[/TD]
[TD="bgcolor: transparent, align: right"]2/19/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT03190145[/TD]
[TD="bgcolor: transparent"]A-335757[/TD]
[TD="bgcolor: transparent, align: right"]3/19/2019[/TD]
[TD="bgcolor: transparent, align: right"]3/14/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS12280034[/TD]
[TD="bgcolor: transparent"]A-335780[/TD]
[TD="bgcolor: transparent, align: right"]12/28/2018[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT03220089[/TD]
[TD="bgcolor: transparent"]A-335780[/TD]
[TD="bgcolor: transparent, align: right"]3/22/2019[/TD]
[TD="bgcolor: transparent, align: right"]3/8/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT03010142[/TD]
[TD="bgcolor: transparent"]A-336952[/TD]
[TD="bgcolor: transparent, align: right"]3/1/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT06050101[/TD]
[TD="bgcolor: transparent"]A-336952[/TD]
[TD="bgcolor: transparent, align: right"]6/5/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/29/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT01070052[/TD]
[TD="bgcolor: transparent"]A-358773[/TD]
[TD="bgcolor: transparent, align: right"]1/7/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05280161[/TD]
[TD="bgcolor: transparent"]A-358773[/TD]
[TD="bgcolor: transparent, align: right"]5/28/2019[/TD]
[TD="bgcolor: transparent, align: right"]5/28/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT01180090[/TD]
[TD="bgcolor: transparent"]A-360215[/TD]
[TD="bgcolor: transparent, align: right"]1/18/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05020219[/TD]
[TD="bgcolor: transparent"]A-360215[/TD]
[TD="bgcolor: transparent, align: right"]5/2/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/26/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RS09060234[/TD]
[TD="bgcolor: transparent"]A-360451[/TD]
[TD="bgcolor: transparent, align: right"]9/6/2018[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT03010097[/TD]
[TD="bgcolor: transparent"]A-360451[/TD]
[TD="bgcolor: transparent, align: right"]3/1/2019[/TD]
[TD="bgcolor: transparent, align: right"]2/20/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT01300086[/TD]
[TD="bgcolor: transparent"]A-360666[/TD]
[TD="bgcolor: transparent, align: right"]1/30/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05120051[/TD]
[TD="bgcolor: transparent"]A-360666[/TD]
[TD="bgcolor: transparent, align: right"]5/12/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/25/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT01210130[/TD]
[TD="bgcolor: transparent"]A-362214[/TD]
[TD="bgcolor: transparent, align: right"]1/21/2019[/TD]
[TD="bgcolor: transparent"] [/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT04240052[/TD]
[TD="bgcolor: transparent"]A-362214[/TD]
[TD="bgcolor: transparent, align: right"]4/24/2019[/TD]
[TD="bgcolor: transparent, align: right"]4/23/2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]RT05220057[/TD]
[TD="bgcolor: transparent"]A-362214[/TD]
[TD="bgcolor: transparent, align: right"]5/22/2019[/TD]
[TD="bgcolor: transparent, align: right"]5/20/2019[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I have no idea which columns and rows your data is in, but if it is in columns A:D and has headers in row 1 with data beginning in row 2, and you have no formulas in column D, the you could simply click on cell D2, right click, choose Delete from the pop up menu and then Shift Up from the options.
 
Upvote 0
Isn't this the Access forum?
This would be a tough query to figure out, I think. Thought I had something for a moment then I notice you have barcodes that have 4 dates when at first I thought the 2nd instance of barcode was always going to have no date. IMO, would take some code finagling (an inner and outer loop through a recordset). I can't think of a subquery approach because there is no consistent pattern, such as all 2nd row barcodes are null.

Another thought is to build a form that has duplicate barcode records and you copy from one field to the other (over-writing one) or do this right in the table field if it's a one time thing

P.S. - sorry if that first comment seemed snippy. Was not my intention
 
Last edited:
Upvote 0
I am doing this all in Access. It has been a bear to figure out. The loop through a recordset was going to be my next attempt at this. Thanks for the feedback.
 
Upvote 0
I am doing this all in Access. It has been a bear to figure out. The loop through a recordset was going to be my next attempt at this. Thanks for the feedback.

Since this is an Excel forum, it would be helpful to know that you are working in a different application at the outset. Access has a different construct to its record set than Excel so data is manipulated by record rather than by rows and columns.
 
Upvote 0
JLFGWhiz, I am sorry, I was under the impression that I was in the Access forum when I posted this. I was in the forum doing a search when I posted this.
 
Upvote 0
You were/are in an access forum. JLGWhiz, perhaps you picked this up from the Zero replies which includes posts from all of the forums on this board?

Tcurtis: I am struggling to work out the logic from your example. each barcode seems to appear in 2 rows on both the first and second data set. is that correct?
 
Upvote 0
You were/are in an access forum. JLGWhiz, perhaps you picked this up from the Zero replies which includes posts from all of the forums on this board?

Tcurtis: I am struggling to work out the logic from your example. each barcode seems to appear in 2 rows on both the first and second data set. is that correct?

Red face! It went completely by me. :crash: Of course, I blame it on senility.
 
Upvote 0
After reviewing my post I see that it could be construed that it was directed to the OP but is wasn't. Whenever I have my doubts I look at the thread cookies at the top to see where the post is. Can save some embarrassment because I did the same thing before (from the unanswered threads page).

As for the original problem, I have no more suggestions due to the uncertainty I pointed out.
 
Upvote 0
I'm waiting for answer to Stumac's question - or in general some more context. The semantics are not clear - why is the second case "right" and the first case "wrong". At first glance it seems you are just filling in a missing value but that's also seems like an insufficient explanation to cover all cases.

As a rule, with relational databases, you really can't define a problem in terms of "first row, second row" - it has to be defined in terms of the data. You can get something like "first row, second row" solutions by ordering records and dealing with them that way but it's clunky and usually not ideal - for instance, in this case, if you do use ordering, then you are relying on the "first row" always having the data and the "second row" always missing it, which is probably not a good way to approach data.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top