PC Review


Reply
Thread Tools Rate Thread

Combine two records in a table

 
 
clk
Guest
Posts: n/a
 
      27th Aug 2010
Hi. I have a database that I am using to manipulate data to export
to
another program. I import a text file, make modification and then
export another text file with all the modifications. One thing that
happens is the original file that is imported may contain duplicate
records.

Below is a scenario that exists.

Point_Name x1 y1 x2
y2
1 123 465
2 888 999
2 777 000
4 456 566


What I need is below. The end result should be that Point_Name "2"
get combined with the other Point_Name "2". The top one leaves the x1/
y1 coordinates alone but the second Point-Name2 x1/y1 coordinates get
placed in x2/y2 fields.


Point_Name x1 y1 x2 y2
1 123 465
2 888 999 777
000
4 456 566


I hope this makes sense. x2 and y2 are blank unless there are two
identical
Point-Names. Any help would be greatly appreciated.


Thank you.


 
Reply With Quote
 
 
 
 
clk
Guest
Posts: n/a
 
      10th Sep 2010
On Aug 30, 1:07*pm, "Arvin Meyer" <arv...@invalid.org> wrote:
> What happens if there are more than 2 identical Point-Names?
>
> Here's how you can get a list of the dupe Point-Names:
>
> SELECT *[Point-Names], [x1], [y1], [x2], [y2]
> FROM YourTable
> WHERE [Point-Names] In (SELECT [Point-Names] FROM [YourTable] As Tmp GROUP
> BY [Point-Names] HAVING Count(*)>1 )
> ORDER BY [Point-Names];
>
> --
> Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.accessmvp.comhttp://www.mvps.org/access
> Co-author: "Access Solutions", published by Wiley
>
> "clk" <c.kur...@comcast.net> wrote in message
>
> news:1e16540f-65d9-4aea-a98d-(E-Mail Removed)...
>
>
>
> > Hi. *I have a database that I am using to manipulate data to export
> > to
> > another program. *I import a text file, make modification and then
> > export another text file with all the modifications. *One thing that
> > happens is the original file that is imported may contain duplicate
> > records.

>
> > Below is a scenario that exists.

>
> > Point_Name * x1 * * * * * * * * *y1 * * * ** * *x2
> > y2
> > 1 * * * * * * * * * 123 * * * * * * * 465
> > 2 * * * * * * * * * 888 * * * * * * * 999
> > 2 * * * * * * * * * 777 * * * * * * * 000
> > 4 * * * * * * * * * *456 * * * * * * *566

>
> > What I need is below. *The end result should be that Point_Name "2"
> > get combined with the other Point_Name "2". *The top one leaves the x1/
> > y1 coordinates alone but the second Point-Name2 x1/y1 coordinates get
> > placed in x2/y2 fields.

>
> > Point_Name * x1 * * * * * * * * *y1 * * * **x2 * * * * * * * * * y2
> > 1 * * * * * * * * * 123 * * * * * * * 465
> > 2 * * * * * * * * * 888 * * * * * * * 999 * * * * 777
> > 000
> > 4 * * * * * * * * *456 * * * * * * *566

>
> > I hope this makes sense. *x2 and y2 are blank unless there are two
> > identical
> > Point-Names. *Any help would be greatly appreciated.

>
> > Thank you.- Hide quoted text -

>
> - Show quoted text -


Thank you for the suggestion. I am working on it now. They assure me
that there will never be more than two.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combine records in a table slickdock Microsoft Access VBA Modules 5 11th Aug 2009 07:16 PM
How to combine two tables and dedup records from one table =?Utf-8?B?Y2FicmFkbGV5MTE=?= Microsoft Access Queries 2 25th Apr 2006 04:25 AM
Do I have to have equal number of records in each table to combine them? david.isaacks@mail.va.gov Microsoft Access Queries 14 20th Apr 2006 10:27 PM
Creating a new table to combine records ie. Mr and Mrs. =?Utf-8?B?THlubiBDYXJsdG9u?= Microsoft Access 2 3rd Dec 2004 07:03 AM
Combine Subsequent Table Records David Frazell Microsoft Access VBA Modules 1 24th May 2004 08:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:31 PM.