473,805 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query stuck

When I run my query it stuck is it possible that i can debug it

SELECT TOP 1 tblCredits.OPR, Min(tbl_CRCDoll ars.SumOfAMOUNT ) AS
MinOfSumOfAMOUN T, Avg(tblCredits. Credit) AS AvgOfCredit,
Count(tblCredit s.OPR) AS CountOfOPR1,
tbl_WorkingCoun tDays.CountOfRE PORT_DATE,
([qry_TopDollarAv gDays]![CountOfOPR])/([qry_TopDollarAv gDays]![CountOfREPORT_D ATE])
AS AvgNum INTO tbl_TopRep
FROM tbl_CRCDollars, qry_TopDollarAv gDays, tbl_WorkingCoun tDays,
tblCredits
WHERE (((tblCredits.A DJRSN) Not Like "4*"))
GROUP BY tblCredits.OPR, tbl_WorkingCoun tDays.CountOfRE PORT_DATE,
([qry_TopDollarAv gDays]![CountOfOPR])/([qry_TopDollarAv gDays]![CountOfREPORT_D ATE])
ORDER BY Min(tbl_CRCDoll ars.SumOfAMOUNT );

Thank You

Aug 16 '06 #1
1 2368
Colleen, your query has 4 tables, with no joins.

This gives you a Cartesian product, i.e. every possible combination. So,
even if there were only 100 records in each table, this query would generate
100 million records so it can select the top 1. Do you think this might be
why it gets "stuck"?

One of those source tables looks like it might be a query also, so there's
also more than that going on.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<co*********@gm ail.comwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
When I run my query it stuck is it possible that i can debug it
SELECT TOP 1 tblCredits.OPR,
Min(tbl_CRCDoll ars.SumOfAMOUNT ) AS MinOfSumOfAMOUN T,
Avg(tblCredits. Credit) AS AvgOfCredit,
Count(tblCredit s.OPR) AS CountOfOPR1,
tbl_WorkingCoun tDays.CountOfRE PORT_DATE,
([qry_TopDollarAv gDays]![CountOfOPR])
/([qry_TopDollarAv gDays]![CountOfREPORT_D ATE]) AS AvgNum
INTO tbl_TopRep
FROM tbl_CRCDollars, qry_TopDollarAv gDays, tbl_WorkingCoun tDays, tblCredits
WHERE (((tblCredits.A DJRSN) Not Like "4*"))
GROUP BY tblCredits.OPR,
tbl_WorkingCoun tDays.CountOfRE PORT_DATE,
([qry_TopDollarAv gDays]![CountOfOPR])/([qry_TopDollarAv gDays]![CountOfREPORT_D ATE])
ORDER BY Min(tbl_CRCDoll ars.SumOfAMOUNT );
Aug 16 '06 #2

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

Similar topics

5
4382
by: Bruno Alexandre | last post by:
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under the recorset object.... how can I do this? I'm stuck here.
1
1313
by: Gary W | last post by:
Hello, I am stuck on what is probably a very easy select query. The query is: Select Count(*), Distinct PID, ID, Name From Table 1 Group By PID I get:
2
1314
by: Mike B | last post by:
I apologize if this is off-topic. If it is off-topic, please direct me to a more appropriate group. I am writing an SQL query for a project and am a little stuck. I need to classify a list of employees into age brackets. (E.g.. 16-15, 25-35, etc.) I am using the Micro Focus NetExpress SQL Wizard in DB2 compatibility mode. I created a table AgeBrackets Range | Lower | Upper
3
330
by: Blue Bell Trading - Customer Services | last post by:
Hi, I need to export all data that was despatched on a specified date to an excel file. I tried creating a query but I am stuck? Thanks...
2
1424
by: Mike Curry | last post by:
I have run into a problem, I have 2 fields in my database, both key fields: Table 1 ===== Field X <key> Field Y <key> In field X, there are say about 3 records for each unique Field Y. I let my users query the data base like follows:
7
3318
by: KoliPoki | last post by:
Hello every body. I have a small issue. Problem: I have a table with 4 descriptor columns (type). I need to formulate a query to retrieve a count for each type so I can group by...etc. The view I have works, but doesn't work when I supplement the query with some functions... they just don't like the UNION. The real problem is I can't change any of the udf's or queries, just the view. The view is inner joined back on to the primary...
4
1616
by: KiwiGenie | last post by:
Hi..I’ve been teaching myself access through trial and error and google, but now I am completely confused and STUCK! These are the relevant forms in my database: frm_Recipes: Main form for entering/viewing recipes. Recordsource is tblRecipes. Has a subform – frm_RecipesSubform frm_RecipesSubform: Continuous forms subform on frm_Recipes - shows the ingredients for the recipe displayed on main form. FrmIngredients: Used for entering and...
3
2490
by: deejayquai | last post by:
Hello Simple one this I guess, but I'm quite stuck at the moment. I would like to update the records displayed in my listbox (lstStudents) using criteria selected from my combo (cboForm) in a form. My basic code is:
24
2899
by: Dan2kx | last post by:
Hello to all that read and thank you to all that post Background: I have been tasked to create a holiday database for the employees in my lab, (so expect many more posts) im stuck at the first hurdle, i want to have a table with emplyee details, and to create a new table for each employee to include holiday dates and ammounts etc, so i need a create table query to creat a brand new (unrelated query) for each employee. in the "staff"...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10607
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10359
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10104
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9182
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.