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  

Simple Query



 
 
Thread Tools Display Modes
  #1  
Old December 9th, 2009, 05:23 AM posted to microsoft.public.access.queries
cowichandave
external usenet poster
 
Posts: 12
Default Simple Query

I am quering a database with 10000 records and the end result of the query
should be about 1500 records. It worked once and now it hangs for a bit and
returns 29 million records. What causes that?
--
CowichanDave
  #2  
Old December 9th, 2009, 10:07 AM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 744
Default Simple Query

On Dec 8, 11:23*pm, cowichandave
wrote:
I am quering a database with 10000 records and the end result of the query
should be about 1500 records. It worked once and now it hangs for a bit and
returns 29 million records. What causes that?
--
CowichanDave


sounds like you have a join in there that's wrong or missing. Getting
ridiculous numbers of records (more than are in the table) is a clue
that you have a cartesian product. So check your joins.
  #3  
Old December 9th, 2009, 10:56 AM posted to microsoft.public.access.queries
Brian
external usenet poster
 
Posts: 1,396
Default Simple Query

Too many records could mean that you have multiple tables (or multiple
instances of the same table) with no link between them, so it selects a
record for each combination: that is, if one table has 100 records and
another has 500, but you have not linked at least one field, it will select
all 100 for each of the 500 (or all 500 or each of the 100), either way
resulting in 50000 records.

Try posting the SQL of your query, though, for better analysis.

"cowichandave" wrote:

I am quering a database with 10000 records and the end result of the query
should be about 1500 records. It worked once and now it hangs for a bit and
returns 29 million records. What causes that?
--
CowichanDave

  #4  
Old December 9th, 2009, 04:52 PM posted to microsoft.public.access.queries
cowichandave
external usenet poster
 
Posts: 12
Default Simple Query

Thank you. That is exactly what the problem was. I had 4 tables originally
and then modified the query using 3 of them and left the 4th unlinked. I was
not aware that the unlinked table would be used in the query.
--
CowichanDave


"Brian" wrote:

Too many records could mean that you have multiple tables (or multiple
instances of the same table) with no link between them, so it selects a
record for each combination: that is, if one table has 100 records and
another has 500, but you have not linked at least one field, it will select
all 100 for each of the 500 (or all 500 or each of the 100), either way
resulting in 50000 records.

Try posting the SQL of your query, though, for better analysis.

"cowichandave" wrote:

I am quering a database with 10000 records and the end result of the query
should be about 1500 records. It worked once and now it hangs for a bit and
returns 29 million records. What causes that?
--
CowichanDave

 




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:14 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.