M
mattc66 via AccessMonster.com
Can I export 5 different tables into one ASC file? If so, how?
mattc66 said:Can I export 5 different tables into one ASC file? If so, how?
Granny said:Can I export 5 different tables into one ASC file? If so, how?
Yes, if the table structures are the same you can append a union query into a
text file. But if all 5 tables have the same structure, *why*? It should be
one table with all those records. And if they don't, why would you put 5
dissimilar tables in the same sequential file?
First create a union query like this:
SELECT *
FROM tbl1
UNION ALL
SELECT *
FROM tbl2
UNION ALL
SELECT *
FROM tbl3
UNION ALL
SELECT *
FROM tbl4
UNION ALL
SELECT *
FROM tbl5;
If you don't want duplicate records, remove the the ALL from every UNION ALL.
Save this and name it qryUnion. Create a new query like this and run it:
SELECT * INTO [Text;HDR=YES;DATABASE=C:\IMDB\].Textfile.txt
FROM qryUnion;
mattc66 via AccessMonster.com said:They are different tables. Its for EDI 850 ascii file upload.
Granny said:Can I export 5 different tables into one ASC file? If so, how?
Yes, if the table structures are the same you can append a union query
into a
text file. But if all 5 tables have the same structure, *why*? It should
be
one table with all those records. And if they don't, why would you put 5
dissimilar tables in the same sequential file?
First create a union query like this:
SELECT *
FROM tbl1
UNION ALL
SELECT *
FROM tbl2
UNION ALL
SELECT *
FROM tbl3
UNION ALL
SELECT *
FROM tbl4
UNION ALL
SELECT *
FROM tbl5;
If you don't want duplicate records, remove the the ALL from every UNION
ALL.
Save this and name it qryUnion. Create a new query like this and run it:
SELECT * INTO [Text;HDR=YES;DATABASE=C:\IMDB\].Textfile.txt
FROM qryUnion;