Info about option other than UNION qry

Les Blair

Registered User.
Local time
Today, 09:03
Joined
Sep 10, 2007
Messages
49
I have two tables that I need to put together for reporting. The problem is that when I run a UNION query it tells me that I have exceeded the number of fields. Each table has about 160 fields. One table is the current information and the other is a purged history. Is there another way I can solve this problem?:confused:
 
About the only way I can think of is to create a combined table using two Append queries.
 
Thank you, that was what I had come with also but I was hoping someone have a different way. I will use that solution.
 
Um...

You could always section your data off into seperate tables, keeping the key field as a linking mechanism and run your union queries, then link them back together...
 
What bothers me about that is that you describe something that should not occur.

Structurally, a UNION query "stacks" two tables of similar structure, one atop the other, and you riffle through them as though they were a single stack. To have too many fields, the 160 fields in each must not overlap completely.

A JOIN with 160 fields in each table would give back 320 fields - clearly too many because of the limit of 255. But a proper UNION of two tables with 160 fields each should yield twice as many records but still of only 160 fields each. So I'm confused.

What bothers me more is that it is rare to need that many fields even ONCE, let alone twice. I suspect that to start this whole shebang, your tables aren't normalized. That is SUSPECT, not AVOW. If you could normalize the tables, you might be able to avoid the problem altogether.

If you are in doubt, read up on "Database Normalization." If you know about that already, all I can say is that 160 is a lot of fields for a single table.
 
I agree and after looking at the requirements we will not need to have that big a UNION. we have only selected the fields for the reporting and it work find. Thanks for all you help
 
I'll be a bit more direct than The Doc Man. Your design is 99% certain to be wrong. Tbales should be long and narrow, not short and fat.
 

Users who are viewing this thread

Back
Top Bottom