views:

36

answers:

2

Hi,

I had a table with some 25000 records and 75 fields. For easier analysis i broke them down into 10 tables with 2500 records each. now i want to put them back together to form a single table. how do i write a query. i tried a select query like select * from (table1, table2.....) but i get error as query is too complex.

tksy

A: 
select * from tableA
union
...
select * from tableN
eugeneK
error is "too many fields defined"
tksy
is there counter ? Auto Identity field of somekind ?
eugeneK
yes the first field is an auto number field
tksy
could be it, try to exclude it from selection
eugeneK
doesnt make a difference
tksy
maybe you missed some column here and there ? try to compact the database could be internal counter causing this because Access has 255 columns per table limitation and even if you delete columns settings for counter are saved
eugeneK
+1  A: 

Explicitly select the field, to ensure a perfect match when you use UNION.

For example,

SELECT
    FirstName,
    Surname
FROM
    tblCustomer1

UNION

SELECT
    Name [Firstname],
    Surname
FROM
    tblCustomer2

Select the specific columns you want and make sure they are all named identically and contain the same data type.

Sohnee
I NEED ALL THE COLUMNS SOME 72 COLUMNS IN AL TABLES
tksy
You'll need to list them all then - the good news is that you can copy and paste it once you've listed it once.
Sohnee