A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Expression Too Complex



 
 
Thread Tools Display Modes
  #1  
Old January 9th, 2007, 02:09 PM posted to microsoft.public.access.queries
ACWOKING
external usenet poster
 
Posts: 3
Default Expression Too Complex

Here's one for you !!

I have a large data set of figures 200 000 deep and with 59 columns. The
columns represent each product and the rows represent individual records.

I am attempting to write a query in design view that returns the smallest
figures per row. (I.e. Top 3 products per record by price) I have done this
successfully for the first 29 columns and then i receive an error message
"Expression Too Complex" when i go further.

Tell me how i can get round this showstopper without changing the structure
of the table because to be honest the table is too large to manipulate and
the data is presented in this format anyway.

Thanks
  #2  
Old January 9th, 2007, 03:45 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Expression Too Complex

You can't. Sorry to say that if you have a column per product, the problem is
that your table is not properly normalized. That leads to overly complex SQL
statements as you've found out. What happens when you need to add another
product? You have to change all queries, forms, and reports don't you?

If you normalize your data properly, your queries would be much simpler and
the ability to add products will be greatly simplified.

I highly suggest getting some relational database training or reading
"Database Design for Mere Mortals" by Hernandez before proceeding any further
on this database.

As far as presenting the information, once properly normalized you can run a
crosstab query to display the data in reports if needed that way.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"ACWOKING" wrote:

Here's one for you !!

I have a large data set of figures 200 000 deep and with 59 columns. The
columns represent each product and the rows represent individual records.

I am attempting to write a query in design view that returns the smallest
figures per row. (I.e. Top 3 products per record by price) I have done this
successfully for the first 29 columns and then i receive an error message
"Expression Too Complex" when i go further.

Tell me how i can get round this showstopper without changing the structure
of the table because to be honest the table is too large to manipulate and
the data is presented in this format anyway.

Thanks

  #3  
Old January 9th, 2007, 04:30 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Expression Too Complex

The simplest way to solve this might be to build a new table that normalizes
your data. How to do that would depend on the structure of the data as it
now exists.

You could write a Vba function to get the three lowest values for each row.
Without knowing more about your row structure it is hard to say how to solve
the problem even with VBA. Also, what do you want returned - the three
values or the names of the columns or something else?

Does each row have a primary key?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"ACWOKING" wrote in message
...
Here's one for you !!

I have a large data set of figures 200 000 deep and with 59 columns. The
columns represent each product and the rows represent individual records.

I am attempting to write a query in design view that returns the smallest
figures per row. (I.e. Top 3 products per record by price) I have done
this
successfully for the first 29 columns and then i receive an error message
"Expression Too Complex" when i go further.

Tell me how i can get round this showstopper without changing the
structure
of the table because to be honest the table is too large to manipulate and
the data is presented in this format anyway.

Thanks



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.