Combining records in access 2007

B

barmatt80

I have imported a text file into access 2007. However I guess when
the person that exported the text files(i think they are from a sql
server db), what was one record in the sql server db, is now broken
down into two records in the text file.

I am needing to try to take the text files once imported into a table
in access to combine two records into one. I just have a autonumber
field that is the primary key for each field.

So my table looks like this(original_table):

Column 1 Column 2 Column 3
1 ABC DEF
2 GHI JKL
3 MNO PQR
4 STU VWX

Result would look like(result table)

Column 1 Column 2 Colummn 3 Column 4 Column 5
1 ABC DEF GHI
JKL
2 MNO PQR STU VWX

The problem is that there is about 20,000 records in the database,
and I have 55 tables.

I am all new to this, I would greatly appreciate some help. If doing
it before going into access that would work to, I just need the end
result to look like the result table.

Thank you.
 
J

Jahanzaib

Hi,
Can you reply with your 'Text to be imported in access' , It will help me to
help you.

JB
 
K

Kerry

I have imported a text file into access 2007. However I guess when
the person that exported the text files(i think they are from a sql
server db), what was one record in the sql server db, is now broken
down into two records in the text file.

I am needing to try to take the text files once imported into a table
in access to combine two records into one. I just have a autonumber
field that is the primary key for each field.

So my table looks like this(original_table):

Column 1 Column 2 Column 3
1 ABC DEF
2 GHI JKL
3 MNO PQR
4 STU VWX

Result would look like(result table)

Column 1 Column 2 Colummn 3 Column 4 Column 5
1 ABC DEF GHI
JKL
2 MNO PQR STU VWX

The problem is that there is about 20,000 records in the database,
and I have 55 tables.

I am all new to this, I would greatly appreciate some help. If doing
it before going into access that would work to, I just need the end
result to look like the result table.

Thank you.

How about creating a query called Odd with SQL:
SELECT Table1.[Column 1], Table1.[Column 2], Table1.[Column 3]
FROM Table1
WHERE (((([Column 1]+1)/2=Int(([Column 1]+1)/2))=True));

another query called Even with SQL:
SELECT [Column 1]-1 AS MatchColumn1, Table1.[Column 2], Table1.[Column
3]
FROM Table1
WHERE ((([Column 1]/2=Int([Column 1]/2))=True));

and a third query with SQL:
SELECT Odd.*, Even.[Column 2] AS [Column 4], Even.[Column 3] AS
[Column 5]
FROM Odd INNER JOIN Even ON Odd.[Column 1] = Even.MatchColumn1;
 
B

barmatt80

I have imported a text file into access 2007. However I guess when
the person that exported the text files(i think they are from a sql
server db), what was one record in the sql server db, is now broken
down into two records in the text file.
I am needing to try to take the text files once imported into a table
in access to combine two records into one. I just have a autonumber
field that is the primary key for each field.
So my table looks like this(original_table):
Column 1 Column 2 Column 3
1 ABC DEF
2 GHI JKL
3 MNO PQR
4 STU VWX
Result would look like(result table)
Column 1 Column 2 Colummn 3 Column 4 Column 5
1 ABC DEF GHI
JKL
2 MNO PQR STU VWX
The problem is that there is about 20,000 records in the database,
and I have 55 tables.
I am all new to this, I would greatly appreciate some help. If doing
it before going into access that would work to, I just need the end
result to look like the result table.
Thank you.

How about creating a query called Odd with SQL:
SELECT Table1.[Column 1], Table1.[Column 2], Table1.[Column 3]
FROM Table1
WHERE (((([Column 1]+1)/2=Int(([Column 1]+1)/2))=True));

another query called Even with SQL:
SELECT [Column 1]-1 AS MatchColumn1, Table1.[Column 2], Table1.[Column
3]
FROM Table1
WHERE ((([Column 1]/2=Int([Column 1]/2))=True));

and a third query with SQL:
SELECT Odd.*, Even.[Column 2] AS [Column 4], Even.[Column 3] AS
[Column 5]
FROM Odd INNER JOIN Even ON Odd.[Column 1] = Even.MatchColumn1;- Hide quoted text -

- Show quoted text -

Sorry guys, I have been away on familly business. I will try what
kerry said and see if i can get it to work. Thanks.
 
B

barmatt80

I have imported a text file into access 2007. However I guess when
the person that exported the text files(i think they are from a sql
server db), what was one record in the sql server db, is now broken
down into two records in the text file.
I am needing to try to take the text files once imported into a table
in access to combine two records into one. I just have a autonumber
field that is the primary key for each field.
So my table looks like this(original_table):
Column 1 Column 2 Column 3
1 ABC DEF
2 GHI JKL
3 MNO PQR
4 STU VWX
Result would look like(result table)
Column 1 Column 2 Colummn 3 Column 4 Column 5
1 ABC DEF GHI
JKL
2 MNO PQR STU VWX
The problem is that there is about 20,000 records in the database,
and I have 55 tables.
I am all new to this, I would greatly appreciate some help. If doing
it before going into access that would work to, I just need the end
result to look like the result table.
Thank you.

How about creating a query called Odd with SQL:
SELECT Table1.[Column 1], Table1.[Column 2], Table1.[Column 3]
FROM Table1
WHERE (((([Column 1]+1)/2=Int(([Column 1]+1)/2))=True));

another query called Even with SQL:
SELECT [Column 1]-1 AS MatchColumn1, Table1.[Column 2], Table1.[Column
3]
FROM Table1
WHERE ((([Column 1]/2=Int([Column 1]/2))=True));

and a third query with SQL:
SELECT Odd.*, Even.[Column 2] AS [Column 4], Even.[Column 3] AS
[Column 5]
FROM Odd INNER JOIN Even ON Odd.[Column 1] = Even.MatchColumn1;- Hide quoted text -

- Show quoted text -

Actually I just noticed that I was wrong in my original post: My
columns within access are:

Col1 Col2 Col3 Col4 Col5
1 abc def ghi jkl
1 mno pqr stu vwx
1 yz aaa bbb ccc
2 ddd ee fff g
2 h iiiii jjj kk

I am needing to combine the records where col1 values are equal.

Sorry for the mix up.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top