473,416 Members | 1,518 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

"Query is too complex" error

Hi all, Thank you for taking the time.

I have a database with 45 tables on it. 44 tables are linked to a main
table through a one to one relationship.

My question is, is there no way i can have a query that will pull a
single field from all the tables. In other words i should have 44
fields. when i try to do that same, i get an error message saying
"Query is too complex"

i tried splitting the query into 4 different queries with each having
10 tables, but when i try to merge the 4 queries, it still gives me
the same message. any help would be greatly appreciated.

Thanks again.
Nov 13 '05 #1
8 5035
Is there a reason you have 44 1-to-1 relationships? That sounds odd in itself.
Nov 13 '05 #2
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf**************************@posting.google. com>...
Is there a reason you have 44 1-to-1 relationships? That sounds odd in itself.


have 44 tables with the exact same fields except for one field, & that
is the department name. there are 44 different departments & this
database would track the same variables for all the departments for a
given date. the reason i had a had a one to one relationship is that i
need to query on a particular department or departments.. hope that
explains it.
Nov 13 '05 #3
Matt,
Jeeze. 44 one-to-one relationships. A lot of designers would argue (and I
agree), that for one-to-one relationships the easiest way to go is stick
them all in one table. You can use views to parse them out and present them
as 44 different tables to the user community. Now, your query is too
complex because you need 44 joins to present your 45 tables in a one-to-one
relationship. Access is basically giving up. I think you've succeeded in
exceeding the number of joins Jet will support. As a rule of thumb its wise
to design things so that a view uses no more than three joins. The rule
dates from the days when disk space, memory & processor time were expensive
and SQL that used more than three joins became a resource (read money) hog.
If at all possible, put all those tables in a one-to-one relationship back
together in one table. Then go back to the user community and identify
their needs so that as needed you can design views to present the data in a
way that is useful to them.

"Matt" <yo*******@yahoo.com> wrote in message
news:fe**************************@posting.google.c om...
Hi all, Thank you for taking the time.

I have a database with 45 tables on it. 44 tables are linked to a main
table through a one to one relationship.

My question is, is there no way i can have a query that will pull a
single field from all the tables. In other words i should have 44
fields. when i try to do that same, i get an error message saying
"Query is too complex"

i tried splitting the query into 4 different queries with each having
10 tables, but when i try to merge the 4 queries, it still gives me
the same message. any help would be greatly appreciated.

Thanks again.

Nov 13 '05 #4
Matt,
Boy, talk about making your life hard at the outset. Ok, your department
columns *really* need to be 44 rows in one table with all the columns you
have plus a column named "DEPARTMENT" As for presenting the departments in
44 columns, look at the pivot table view of Access XP or pivot tables in
Excel. You have way more flexibility with presenting the data columnwise,
rowwise, or whatever your users desire. 44 tables, one each for each
deparment? My head hurts.

"Matt" <yo*******@yahoo.com> wrote in message
news:fe**************************@posting.google.c om...
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf**************************@posting.google. com>...
Is there a reason you have 44 1-to-1 relationships? That sounds odd in

itself.
have 44 tables with the exact same fields except for one field, & that
is the department name. there are 44 different departments & this
database would track the same variables for all the departments for a
given date. the reason i had a had a one to one relationship is that i
need to query on a particular department or departments.. hope that
explains it.

Nov 13 '05 #5
yo*******@yahoo.com (Matt) wrote in message news:<fe**************************@posting.google. com>...
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf**************************@posting.google. com>...
Is there a reason you have 44 1-to-1 relationships? That sounds odd in itself.


have 44 tables with the exact same fields except for one field, & that
is the department name. there are 44 different departments & this
database would track the same variables for all the departments for a
given date. the reason i had a had a one to one relationship is that i
need to query on a particular department or departments.. hope that
explains it.


Okay, so now I *definitely* agree with Alan. Put it all the records
in one table, index it, and filter the table. Then you can just open
a parameterized query and just pass different parameters to it.
Infinitely easier/more practical than the alternatives. Especially if
you ever need to update your structure. (Don't know about you, but
after about the third time, I'd be ready to throw in the towel!)
Having that many tables to manage just seems like a TON of unnecessary
work.
Nov 13 '05 #6
thanks all for your time. Not trying to be rude here, but i still
think my design will be the best i can think off for my situation. Ok
let me explain the situation.

why did i not have them in a single table ? coz at the end of the
shift, the person who would be entering information don't have to
create a single record for each and every department. i have a main
form with the date,shift number & an autonumber as an id, with 44
subforms on a tab control. so all he has to do is type in date & shift
number once & then add information about different departments.

Is that the only reason i had made 44 tables?? no!....another reason
why having 44 tables will be well suited is, a report needs to be
generated in a particular manner & with the way the departments are
named its impossible to sort them. not to mention, printing
performance charts would be another impossible thing to do if they
cannot be sorted.

This database will be used by people who are not really good on
computers. I can think of so many other reasons that would make it
more difficult for them while entering data if it was on a single
table.

I hope i explained it well. Please let me know what you guys think.

Note: I figured out a way to perform the calculation without adding
all the 44 tables in the query. it will be 10 tables at the max. hence
"query too complex" error is solved.

But now you guys make me worry about my design...lol
Nov 13 '05 #7
Matt,
I'll bet you a dollar I could meet your user's requirements by using one
table and a bunch of views. I'll bet another dollar that my way would be
cheaper to maintain, faster, and based on those two improvements, better
than yours. If you are doing charts I still think you should look at the
pivot table view added in Access 2002. It's a very cool feature that works
a lot like the similarly named feature in Excel.

"Matt" <yo*******@yahoo.com> wrote in message
news:fe**************************@posting.google.c om...
thanks all for your time. Not trying to be rude here, but i still
think my design will be the best i can think off for my situation. Ok
let me explain the situation.

why did i not have them in a single table ? coz at the end of the
shift, the person who would be entering information don't have to
create a single record for each and every department. i have a main
form with the date,shift number & an autonumber as an id, with 44
subforms on a tab control. so all he has to do is type in date & shift
number once & then add information about different departments.

Is that the only reason i had made 44 tables?? no!....another reason
why having 44 tables will be well suited is, a report needs to be
generated in a particular manner & with the way the departments are
named its impossible to sort them. not to mention, printing
performance charts would be another impossible thing to do if they
cannot be sorted.

This database will be used by people who are not really good on
computers. I can think of so many other reasons that would make it
more difficult for them while entering data if it was on a single
table.

I hope i explained it well. Please let me know what you guys think.

Note: I figured out a way to perform the calculation without adding
all the 44 tables in the query. it will be 10 tables at the max. hence
"query too complex" error is solved.

But now you guys make me worry about my design...lol

Nov 13 '05 #8
yo*******@yahoo.com (Matt) wrote in message news:<fe**************************@posting.google. com>...
thanks all for your time. Not trying to be rude here, but i still
think my design will be the best i can think off for my situation. Ok
let me explain the situation.

why did i not have them in a single table ? coz at the end of the
shift, the person who would be entering information don't have to
create a single record for each and every department. i have a main
form with the date,shift number & an autonumber as an id, with 44
subforms on a tab control. so all he has to do is type in date & shift
number once & then add information about different departments.
Is your concern re-entering the date and shift number? Get the code
from accessweb to grab the value from the previous record.
Is that the only reason i had made 44 tables?? no!....another reason
why having 44 tables will be well suited is, a report needs to be
generated in a particular manner & with the way the departments are
named its impossible to sort them. not to mention, printing
performance charts would be another impossible thing to do if they
cannot be sorted.
So create a table of departments and put some kind of sort key in
there... and a grouping key if you want... The users wouldn't
necessarily have to see any of this if you created a good interface...
This database will be used by people who are not really good on
computers. I can think of so many other reasons that would make it
more difficult for them while entering data if it was on a single
table.

But now you guys make me worry about my design...lol


I would be worried about a design like that. Seems like an
*incredible* amount of work for a job that should be almost trivial,
given a well-designed database. If you're worried about
outputs/reports, then could you give a few examples that you don't
think can be solved with a query on a few tables?
Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Starbuck | last post by:
OK, first let me say that I am no DB person. But I have a user here who keeps getting this error whenever she does, whatever it is she does, with databases... A google search takes me to...
9
by: Mike Bridge | last post by:
I am using MS Access 2003, and I typed in a query in SQL view which was working fine. Now when I open it, it gives me the error "Join expression not supported". Apparently, Access "fixed" it for...
12
by: Russ | last post by:
I tried the following: >>> x = complex(4) >>> y = x >>> y *= 2 >>> print x, y (4+0j) (8+0j) But when I tried the same thing with my own class in place of "complex" above, I found that both...
4
by: Mike D | last post by:
OS: Windows XP Professional Microsoft Access 2003 I am trying to update a table in my DB from a tempory table. I need to ensure that if records in the main table match records in the temp...
1
by: wayniac | last post by:
I am having a problem when I try and remove several fields from the lookup. I have many fields, and the error I am getting is "Expression is too complex", is there anyway of going around this or...
3
by: geebanga88 | last post by:
Hi i am using oracle sql developer and am making a sub query for a question. The question states: "Find Name of patients who have been treated by Dr Brian or who have had an Extended...
1
by: Rahul Babbar | last post by:
Hi, I ran the scripts in a file from Command Line Processor and it gave the error for all the constraints being added, but not the indexes being added. For a simple statement like Alter...
8
geolemon
by: geolemon | last post by:
I'm trying to perform an update, and I can't avoid this error - I've tried this query what must be 5 different very fundamentally different ways now. Arg. I used to be a DBA in large DB2 and SQL...
1
cori25
by: cori25 | last post by:
Paycode': IIf(="01","Meeting",IIf(="02","Training",IIf(="04","Special Project",IIf(="05","QC",IIf(="06","MDU",IIf(="07","UG",IIf(="08","2nd Man",IIf(="09","Sr Tech Other",IIf(="10-1","Loan Out to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.