Senin, 07 November 2016

Re: [MS_AccessPros] Query not responding

 

The first thing I would do is to stop using totg in other expressions. I always use the expression and not the derived column.

Substitute Count([Matches for grid - league].id) for totg.


I'm sure there are other ideas but I need time to digest this.


Duane Hookom





From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Phil Knowles pdk444444@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, November 7, 2016 9:29 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Query not responding
 


Here goes - good luck!
 
SELECT [Matches for grid - league].Season, Count([Matches for grid - league].id) AS totg, Avg([Matches for grid - league].totbooks) AS avbk, DCount("id","matches for grid - league","[totbooks]=0 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS 0, DCount("id","matches for grid - league","[totbooks]<11 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [0-10], DCount("id","matches for grid - league","[totbooks]<21 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [0-20], DCount("id","matches for grid - league","[totbooks]<31 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [0-30], DCount("id","matches for grid - league","[totbooks]<41 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [0-40], DCount("id","matches for grid - league","[totbooks]<51 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [0-50], DCount("id","matches for grid - league","[totbooks]<61 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [0-60], DCount("id","matches for grid - league","[totbooks]<66 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [0-65], DCount("id","matches for grid - league","[totbooks]<71 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [0-70], DCount("id","matches for grid - league","[totbooks] between 30 and 40 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [30-40], DCount("id","matches for grid - league","[totbooks] between 40 and 60 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [40-60], DCount("id","matches for grid - league","[sendingsoff]>0 and [refid]= [forms]![live games]![referee] and [season] = '" & [season] & "' and month([date])<>5 ")/[totg] AS [reds%]
FROM [Matches for grid - league]
WHERE (((Month([date]))<>5) AND (([Matches for grid - league].Refid)=[forms]![Live Games]![referee]))
GROUP BY [Matches for grid - league].Season
ORDER BY [Matches for grid - league].Season DESC;
before my last change I had it working on the table 'matches' but I need it to analyse a particular type of match (ie league matches) so I changed it to run on a query which selects just the league matches.
 
there are about 60000 matches and maybe 45000 league matches.
 
cheers
 
Phil


On Monday, 7 November 2016, 15:21, "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:


 
Phil-

If a query is "too big", you should get a "query too complex" error.  If it's taking a long time to run, perhaps it could be optimized.  What's the SQL of the query?

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
http://www.viescas.com/
www.viescas.com
Welcome to the home of John Viescas Consulting. If you’re at all interested in Microsoft Access or SQL Server, this is the place to be! Check out the book ...

 
(Paris, France)




On Nov 7, 2016, at 4:14 PM, Phil Knowles pdk444444@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



Hi John
 
That looks as if it might be where the issue lies - I will look into it and let you know 
 
many thanks for that.
 
Another one for you whilst I have you if you don't mind.
 
I have a query which causes the message 'Access is not responding' - it is quite a complex query in that it has about 12 fields which use fairly involved dcounts.
 
Is it possible that a query simply becomes too 'big' to run? 
 
cheers
 
Phil







__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar