473,387 Members | 1,572 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,387 software developers and data experts.

query is too complex, better way

26
Ok let me start from the start. I have a form that has question in it and the person chooses 0 1 2 -99 for each. The form then needs to add up the numbers for the sub categories in the form. For example question 1-8 deal with communication and can rang from 0 to 16 points. The problem that I'm running into is the -99 which is needed to denote that the question does not ably. So if one of the communication questions is NA then it will make the communication score negative which is not right. In order to get around this I used a query that has the criteria <>-99. But the problem was that it was removing the whole entry for that person and not just the -99 for that question. So to get around this I used the <>-99 for each question separately and then nested the query into one larger query. This should work but with over 40 nested queries I get the error "query is too complex". So, is there a better way to get the questions added up and to ignore -99? Or is the another null value that I could use instead of -99? Can I do something different in the query to skip -99? Should I just do the calculations in the form but Im not that good at VBA.
Sorry for the long post put this is starting to agitate me thank for the help
May 15 '08 #1
3 1475
FishVal
2,653 Expert 2GB
Hi, BUmed.

I've read your previous thread and would make a guess that your databased is not normalized. This is, in most cases the reason for inappropriately large number of tables/queries as well as their complicatedness and inefficiency.

Regards,
Fish
May 15 '08 #2
BUmed
26
This is true. I inherited this data base when I started this job. It is cumbersome and in inefficient. But we are switch to a new system in about 3mounths so I have to live with it for now. So any suggestion that could fill the whole for now.
May 15 '08 #3
NeoPa
32,556 Expert Mod 16PB
Try using Null as the N/A value.

That way you can simply total all matching records and the Null records will be ignored in the calculations.
May 16 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Steven Stern | last post by:
I'm stuck on a host that is still running MYSQL version 3. I need to flatten out a relationship to AND a set of criteria. In a nutshell User UserID UserEmail UserOther
0
by: awarsd | last post by:
------=_NextPart_000_0007_01C34C8B.2CF5D7A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm looking at some search engine where we can have...
3
by: Andrew Mayo | last post by:
There is something very strange going on here. Tested with ADO 2.7 and MSDE/2000. At first, things look quite sensible. You have a simple SQL query, let's say select * from mytab where col1 =...
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...
3
by: Jonathan | last post by:
Hi all! For a match schedule I would like to find all possible combinations of teams playing home and away (without teams playing to themselves of course). I now the simple version works...
4
by: ED | last post by:
I am attempting to to write a query that has a numerous nested IIf statements. The problem that I am having is that it is to long of a query to be built in design mode and when I build it in sql...
2
by: Steve Richfield | last post by:
First, thanks Wayne Morgan, Cost Budde, and Saintor for all the help you've been in getting me through the field of hidden mines in Access. Most of the program now works, so hopefully I am nearing...
2
by: Ben de Vette | last post by:
Hi, I'm using the querybuilder when updating a record in a table (Access). However, I get a "Query is too complex" message. The Primary key is autonumbered. Why is it making such a complex...
10
by: Robert | last post by:
I am an attorney in a non-profit organization and a self-taught programmer. I'm trying to create a client db that will allow me to search for potential conflicts of interest based either on Social...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.